Description Usage Format Details See Also Examples
These named lists contain ready-to-use values for all the fundamental physical constants.
1 2 3 4 5 6 7 |
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.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # the speed of light
syms$c0
# use the constants in a local environment
with(syms, c0)
# attach only Planck-related constants
(lkp <- lookup("planck", ignore.case=TRUE))
idx <- as.integer(rownames(lkp))
attach(syms[idx])
h
plkl
# the same with uncertainty
detach(syms[idx])
attach(syms_with_errors[idx])
h
plkl
# the same with units
detach(syms_with_errors[idx])
attach(syms_with_units[idx])
h
plkl
# the same with everything
detach(syms_with_units[idx])
attach(syms_with_quantities[idx])
h
plkl
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.