You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice for formatting in tibbles but maybe a downside is that people would have to always do as.numeric() to pull the value out. Note that we'd probably want just units to avoid the extra dependency.
Note that R is already taken (by roentgen) so defining an isotope ratio would require removal of this unit (which is probably fine in the isovese context):
units::remove_unit("R")
units::install_unit("R", name = "isotope ratio")
set_units(1:5, "R")
But then R/R cannot be defined because it is by definition unitless and we cannot define unitless in different ways (once as permil = 1e-3 and once as permil = (R/R - 1) * 1000. That's essentially 2 different mappings to unitlessness.
doing math with this effectively will only work if we automatically convert dimensionless "units" into numerics and then the arithmetic will work out okay such that people can do set_units(R/R - 1, "permil") but of course that is dimensionless too so should it get converted to just a number? what a mess
alternatively define completely new vctrs that are R, R/R, and permil but then we're basically already at the level of isotopia package which seems too much overhead and sometimes counterintuitive to use
also been thinking about vctrs that have full size units so it's easy to keep track which ratios are actually involve (similar to isotopia) but the overhead gets pretty nasty with none of the speed of dplyr processing. at the end of the day it might just be best to keep it simple and maybe install "R" and "permil" units but nothing else (still the unitless turning into a number i think would be good - KopfLab/chemunits#5) since that would enable easier math with these units
The text was updated successfully, but these errors were encountered:
It would be nice for formatting in tibbles but maybe a downside is that people would have to always do
as.numeric()
to pull the value out. Note that we'd probably want justunits
to avoid the extra dependency.Note that
R
is already taken (byroentgen
) so defining an isotope ratio would require removal of this unit (which is probably fine in the isovese context):But then R/R cannot be defined because it is by definition unitless and we cannot define unitless in different ways (once as permil = 1e-3 and once as permil = (R/R - 1) * 1000. That's essentially 2 different mappings to unitlessness.
doing math with this effectively will only work if we automatically convert dimensionless "units" into numerics and then the arithmetic will work out okay such that people can do set_units(R/R - 1, "permil") but of course that is dimensionless too so should it get converted to just a number? what a mess
alternatively define completely new vctrs that are R, R/R, and permil but then we're basically already at the level of isotopia package which seems too much overhead and sometimes counterintuitive to use
also been thinking about vctrs that have full size units so it's easy to keep track which ratios are actually involve (similar to isotopia) but the overhead gets pretty nasty with none of the speed of dplyr processing. at the end of the day it might just be best to keep it simple and maybe install "R" and "permil" units but nothing else (still the unitless turning into a number i think would be good - KopfLab/chemunits#5) since that would enable easier math with these units
The text was updated successfully, but these errors were encountered: