Closed vorpalvorpal closed 4 years ago
I'm not sure I follow. Doing this right now is a one-liner, but requires the user to be fully aware of what they're doing:
x <- set_units(drop_units(x), units(y), mode="standard")
or, equivalently for any x
,
x <- set_units(as.numeric(x), units(y), mode="standard")
"Cloning" units goes against the package's rationale, I think.
Often there are situations where some metadata about some value is provided (eg. reporting limit, confidence interval) at a different time or in a different input table to the main table holding the value and the unit. I feel like in such situations, a convenience function that copies the units of one value and applies it to another value would be useful. Something along the lines of the following:
This would also allow for setting units as per point 4 of unit #400 (ie., km -> mile, without conversion). This is useful when the units aren't clear, and you need to do some data exploration to work out what the unit actually is. In such a case changing units without conversion is useful.