Format numbers (with uncertainty) according to the "Guide to the Expression of Uncertainty in Measurement (GUM)"
format_GUM.Rd
Uncertainties are rounded by default to two significant digits. Then, the values are rounded to the precision implied by the uncertainty. If the uncertainty is missing, values are rounded to two significant digits by default. The number of digits and the justification of the output format can be changed.
format_GUM( value, se = NULL, digits = 2, justify = c("decimal", "left", "right", "centre"), na.string = "--", ... )
Arguments
value | numeric values to be formatted. |
---|---|
se | uncertainty values for |
digits | number of significant digits to which |
justify | character (decimal, left, right or centre) to determine the output format
if |
na.string | instead of |
... | additional arguments going to base |
Value
Character vector of rounded and justified values.
References
ISO, IEC, and BIPM OIML. Guide to the Expression of Uncertainty in Measurement. Geneva, Switzerland 1995.
See also
Other Auxiliary:
IQRloadCSVdata()
,
IQRsaveCSVdata()
,
and()
,
aux_explodePC()
,
aux_explode()
,
aux_fileparts()
,
aux_fileread()
,
aux_filewrite()
,
aux_getRelPath()
,
aux_mkdir()
,
aux_na_locf()
,
aux_postFillChar()
,
aux_preFillChar()
,
aux_quantilenumber()
,
aux_rmdir()
,
aux_simplifypath()
,
aux_splitVectorEqualPieces()
,
aux_strFindAll()
,
aux_strrep()
,
aux_strtrim()
,
aux_unlevel()
,
aux_version()
,
calcAICBIC()
,
clusterX()
,
compare_IQRmodel_IQRsysModel_simulation()
,
fit_EmaxModel()
,
geocv()
,
geomean()
,
geosd()
,
ge()
,
ginv()
,
gt()
,
interp0()
,
interp1()
,
interpcs()
,
inv_logit()
,
le()
,
logit()
,
lt()
,
mod()
,
mvrnorm()
,
or()
,
piecewise()
,
progressBar()
,
run_silent_IQR()
,
stopIQR()
,
tempdirIQR()
,
tempfileIQR()
,
warningIQR()
Examples
value <- c(2.0873624, 0.0057687, 0.087865, 3856.9898273, 1736.8735123) se <- c(0.0013756, 0.001765, 0.0006782, 9.23958, 124.79823) niceTable <- data.frame( Value = format_GUM(value, se), StdErr = format_GUM(se) ) print(niceTable)#> Value StdErr #> 1 2.0874 0.0014 #> 2 0.0058 0.0018 #> 3 0.08786 0.00068 #> 4 3857.0 9.2 #> 5 1740 120# Another example assuming 10% uncertainty for all values format_GUM(value, se = "10%")#> [1] " 2.09 " " 0.00577" " 0.0879 " "3860 " "1740 "