Closed ibarraespinosa closed 3 years ago
Hello, I`m getting the warning
Warning messages: 1: 'units::install_symbolic_unit' is deprecated. Use 'install_unit' instead. See help("Deprecated")
I use units::install_symbolic_unit("veh", warn = F) to define a new symbolic unit named "veh" for vehicles.
https://github.com/atmoschem/vein/blob/94ce7e960c1a48bbfcff35c7002530fc71740fdc/R/Vehicles.R#L31
I have tried using install_unit but the program gives error because "veh" is already defined. Is it possible to add a warn logical argument similar to install_symbolic_unit?
Sorry, but this was a bad pattern that we do not want to revisit with the new interface. You shouldn't add a unit each time you call a function. Instead, add all units you need at startup, using the .onLoad
function (and it would be nice to remove them .onUnload
too).
Also, I have a function named remove_units, simialr to drop_units where I remove units converting as.numeric https://github.com/atmoschem/vein/blob/94ce7e960c1a48bbfcff35c7002530fc71740fdc/R/remove_units.R#L21
Is it wrong remove units using as.numeric?
It is fine to use as.numeric
as long as you always want to succeed in that call, because drop_units
fails if the object has no units.
Alright! Many thanks!
Hello, I`m getting the warning
I use units::install_symbolic_unit("veh", warn = F) to define a new symbolic unit named "veh" for vehicles.
https://github.com/atmoschem/vein/blob/94ce7e960c1a48bbfcff35c7002530fc71740fdc/R/Vehicles.R#L31
I have tried using install_unit but the program gives error because "veh" is already defined. Is it possible to add a warn logical argument similar to install_symbolic_unit?
Also, I have a function named remove_units, simialr to drop_units where I remove units converting as.numeric https://github.com/atmoschem/vein/blob/94ce7e960c1a48bbfcff35c7002530fc71740fdc/R/remove_units.R#L21
Is it wrong remove units using as.numeric?