Closed edzer closed 1 year ago
I was bitten by this example:
library(units) # udunits database from /usr/share/xml/udunits/udunits2.xml a = 3 units(a) = NULL a # [1] 3 units(a) = NULL^2 a # 3 [1] NULL^2 # numeric(0) units:::as_units(numeric(0)) # [1]
Note that the last result is ok. The first argument to as_units.default is the value, and the second argument is the unit (unitless by default), so this is the expected output: a unitless empty vector.
as_units.default
I was bitten by this example: