r-quantities / constants

Reference on Constants, Units and Uncertainty
https://r-quantities.github.io/constants
Other
15 stars 0 forks source link

Speed of light not recognised as unit #2

Closed Enchufa2 closed 6 years ago

Enchufa2 commented 6 years ago

With units < 0.5-0, the following code works:

units::parse_unit("c")
#> 1 c

I supposed that it was recognised as the "speed of light", as this is commonly used in Physics. For instance, the Newtonian constant of gravitation can be expressed in m3 kg-1 s-2, but it is commonly expressed in GeV-2 c4 as well.

However, with units >= 0.5-0:

units::as_units("c")
#> Error: In ‘c’, ‘c’ is not recognized by udunits.

It seems that parse_unit() was identifying "c" as the "centi" prefix, and incorrectly returning this prefix as a unit until v0.5-0. This needs to be addressed ASAP in constants, as several CODATA constants are expressed in terms of the speed of light.