syms: Lists of Constants

Description Usage Format Details See Also Examples

Description

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

Usage

1
2
3
4
5
6
7

Format

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

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

codata, lookup.

Examples

 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

constants documentation built on Feb. 25, 2021, 5:06 p.m.