How can I read units into the units
package from a variable? I get the error ...not recognised by udunits
. An MWE below:
library(units)
measurements <- runif(10)
unitsofmeasurement <- "mm"
set_units(measurements, unitsofmeasurement)
returns the error
Error: In ‘unitsofmeasurement’, ‘unitsofmeasurement’ is not recognized by udunits.
but the following works:
set_units(measurements, "mm")
mode = "standard"
to theset_units()
function. – Dippy