Skip to contents

These named lists contain ready-to-use values for all the fundamental physical constants.

Usage

syms

syms_with_errors

syms_with_units

syms_with_quantities

Format

A list, where names correspond to symbols in codata$symbol.

  • syms contains plain numeric values.

  • syms_with_errors contains objects of type errors, which enables automatic uncertainty propagation.

  • syms_with_units contains objects of type units, which enables automatic conversion, derivation and simplification.

  • syms_with_quantities contains objects of type quantities, which combines errors and units.

The enriched versions of syms are available only if the corresponding optional packages, errors, units and/or quantities are installed. See the documentation of these packages for further information.

Details

Experimental support for correlations between constants is provided via the errors package, but it is disabled by default. To enable it, the following option must be set before loading the package:

options(constants.correlations=TRUE)

Alternatively, constants:::set_correlations() may be used interactively, but scripts should not rely on this non-exported function, as it may disappear in future versions.

See also

Examples

# the speed of light
syms$c0
#> [1] 299792458
# use the constants in a local environment
with(syms, c0)
#> [1] 299792458

# attach only Planck-related constants
(lkp <- lookup("planck", ignore.case=TRUE))
#>        symbol                                  quantity
#> 137       nah                     molar Planck constant
#> 198         h                           Planck constant
#> 199       hev                  Planck constant in eV/Hz
#> 200      plkl                             Planck length
#> 201      plkm                               Planck mass
#> 202 plkmc2gev      Planck mass energy equivalent in GeV
#> 203    plktmp                        Planck temperature
#> 204      plkt                               Planck time
#> 230      hbar                   reduced Planck constant
#> 231    hbarev           reduced Planck constant in eV s
#> 232   hbcmevf reduced Planck constant times c in MeV fm
#>                          type        value uncertainty     unit
#> 137          Physico-chemical 3.990313e-10     0.0e+00 J/Hz/mol
#> 198 Universal, Adopted values 6.626070e-34     0.0e+00     J/Hz
#> 199                 Universal 4.135668e-15     0.0e+00    eV/Hz
#> 200                 Universal 1.616255e-35     1.8e-40        m
#> 201                 Universal 2.176434e-08     2.4e-13       kg
#> 202                 Universal 1.220890e+19     1.4e+14      GeV
#> 203                 Universal 1.416784e+32     1.6e+27        K
#> 204                 Universal 5.391247e-44     6.0e-49        s
#> 230 Universal, Adopted values 1.054572e-34     0.0e+00      J*s
#> 231                 Universal 6.582120e-16     0.0e+00     eV*s
#> 232   Universal, Non-SI units 1.973270e+02     0.0e+00   fm*MeV
idx <- as.integer(rownames(lkp))
attach(syms[idx])
h
#> [1] 6.62607e-34
plkl
#> [1] 1.616255e-35

# the same with uncertainty
detach(syms[idx])
attach(syms_with_errors[idx])
h
#> 6.62607(0)e-34
plkl
#> 1.61626(2)e-35

# the same with units
detach(syms_with_errors[idx])
attach(syms_with_units[idx])
h
#> 6.62607e-34 [J/Hz]
plkl
#> 1.616255e-35 [m]

# the same with everything
detach(syms_with_units[idx])
attach(syms_with_quantities[idx])
h
#> 6.62607(0)e-34 [J/Hz]
plkl
#> 1.61626(2)e-35 [m]