Skip to content

Suggestion: as.character.units function #418

@niklhart

Description

@niklhart

Hello everyone,

I was a bit surprised to see that there is no dedicated as.character method for the units class. The default drops units altogether. I'd have expect something similar to the output that format.units provides.

For example, I was expecting

x <- set_units(1,m)
as.character(x)

to return "1 m" or "1 [m]" and not "1".

An additional advantage for an as.character method would be that sprintf would support units as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions