iso_format: Format values

Description Usage Arguments Examples

View source: R/units.R

Description

Convenience function to easily format and concatenate text and numeric values. Can be used with any test and number data. Automatically detects iso_with_units values and incorporates the units into the formatting.

Usage

1
2
3
4
5
6
7
8
iso_format(
  ...,
  signif = 3,
  format_names = "%s: ",
  format_units = "%s",
  replace_permil = TRUE,
  sep = "\n"
)

Arguments

...

variable names with data. Must have the same dimensions if multiple are supplied. Can be named to rename variable name output. Will include units in output for all iso_with_units.

signif

number of significant digits for numbered data

format_names

how to format the variable names, set to NULL to remove names

format_units

how to format the units from iso_double_with_units variables, set to NULL to omit units

replace_permil

whether to replace the term 'permil' with the permil symbol (\u2030)

sep

separator between variables if multiple are provided in ...

Examples

1
2
3
4
x <- iso_with_units(1:5, "V")
y <- iso_with_units(1:5, "permil")
iso_format(x, y)
iso_format(amplitude = x, d13C = y)

isoreader documentation built on Nov. 19, 2021, 1:07 a.m.