signifig: Print significant figures

Description Usage Arguments Author(s) References Examples

View source: R/signifig.R

Description

This function reports the significant figures of a given mean together with its respective error term (for instance confidence interval or standard deviation).

Usage

1
signifig(mean, error, data, signif.na = 2, style = "pm")

Arguments

mean

a numeric vector or data frame object containing the averaged values.

error

a numeric vector or data frame object containing the respective error terms.

data

a data frame containing the specified columns. If empty, mean and error need to be given as numeric vectors.

signif.na

an integer controlling to which significant digit the mean value should be rounded when no error data was given.

style

a string specifying the output style to be used. The default style "pm" reports the results as "3 ± 6", while "par" results in outputs like "0.26 (0.02)". "siunitx" returns "0.26 (2)" which might be used together with xtable for automated LaTeX table outputs.

Author(s)

Zacharias Steinmetz

References

Taylor, J.R. (1997). Error analysis: the study of uncertainties in physical measurements. University Science Books, Sausalito, CA.

Examples

1
signifig(mean = c(0.28,5), error = c(0.688, 8))

envalysis documentation built on March 6, 2021, 1:07 a.m.