Package 'constants'

Title: Reference on Constants, Units and Uncertainty
Description: CODATA internationally recommended values of the fundamental physical constants, provided as symbols for direct use within the R language. Optionally, the values with uncertainties and/or units are also provided if the 'errors', 'units' and/or 'quantities' packages are installed. The Committee on Data for Science and Technology (CODATA) is an interdisciplinary committee of the International Council for Science which periodically provides the internationally accepted set of values of the fundamental physical constants. This package contains the "2018 CODATA" version, published on May 2019: Eite Tiesinga, Peter J. Mohr, David B. Newell, and Barry N. Taylor (2020) <https://physics.nist.gov/cuu/Constants/>.
Authors: Iñaki Ucar [aut, cph, cre]
Maintainer: Iñaki Ucar <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1
Built: 2024-10-27 05:49:49 UTC
Source: https://github.com/r-quantities/constants

Help Index


constants: Reference on Constants, Units and Uncertainty

Description

This package provides the 2018 version of the CODATA internationally recommended values of the fundamental physical constants for their use within the R language.

Author(s)

Iñaki Ucar

References

Eite Tiesinga, Peter J. Mohr, David B. Newell, and Barry N. Taylor (2020). The 2018 CODATA Recommended Values of the Fundamental Physical Constants (Web Version 8.1). Database developed by J. Baker, M. Douma, and S. Kotochigova. Available at https://physics.nist.gov/cuu/Constants/, National Institute of Standards and Technology, Gaithersburg, MD 20899.

See Also

codata, syms, lookup.


CODATA Recommended Values of the Fundamental Physical Constants: 2018

Description

The Committee on Data for Science and Technology (CODATA) is an interdisciplinary committee of the International Council for Science. The Task Group on Fundamental Constants periodically provides the internationally accepted set of values of the fundamental physical constants. This dataset contains the "2018 CODATA" version, published on May 2019.

Usage

codata

codata.cor

Format

An object of class data.frame with the following information for each physical constant: ASCII symbol, quantity description, type, value, uncertainty, unit.

A matrix of correlations between physical constants.

Source

Eite Tiesinga, Peter J. Mohr, David B. Newell, and Barry N. Taylor (2020). The 2018 CODATA Recommended Values of the Fundamental Physical Constants (Web Version 8.1). Database developed by J. Baker, M. Douma, and S. Kotochigova. Available at https://physics.nist.gov/cuu/Constants/, National Institute of Standards and Technology, Gaithersburg, MD 20899.

See Also

syms, lookup.


Lookup for Fundamental Physical Constants

Description

A simple wrapper around grep for exploring the CODATA dataset.

Usage

lookup(pattern, cols = c("symbol", "quantity", "type"), ...)

Arguments

pattern

character string containing a regular expression to be matched (see grep).

cols

columns to perform pattern matching (see codata).

...

additional arguments for grep.

See Also

codata, syms.

Examples

lookup("planck", ignore.case=TRUE)

Lists of Constants

Description

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

codata, lookup.

Examples

# 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