Calculate abundance ratios by dividing input mass column \(i\) over mass 44. $$R_i = mass_i / mass_{44}$$

abundance_ratios(
  .data,
  ...,
  i44 = s44,
  i45 = s45,
  i46 = s46,
  i47 = s47,
  i48 = s48,
  i49 = s49,
  R45 = R45,
  R46 = R46,
  R47 = R47,
  R48 = R48,
  R49 = R49,
  quiet = NULL
)

Arguments

.data

A tibble.

...

These dots are for future extensions and must be empty.

i44, i45, i46, i47, i48, i49

Name of mass x column. Defaults to sx.

R45, R46, R47, R48, R49

Desired new name of the calculated ratio for mass x. Defaults to Rx.

quiet

If TRUE, print info messages. If NULL (default) listens to options(clumpedr.quiet)

Value

Same as .data but with new columns Rx.

Examples

# easily generate some artificial data
x <- function() { rnorm(n = 10) }
dat <- tibble::tibble(s44 = x(), s45 = x(), s46 = x(), s47 = x(), s48 = x(), s49 = x(),
                      r44 = x(), r45 = x(), r46 = x(), r47 = x(), r48 = x(), r49 = x())
dat <- dat |>
  abundance_ratios()
#> Info: calculating abundance ratios R[i] = i / 44
# to specify the column names, for example when we calculate the bg ratios
dat <- dat |>
  abundance_ratios(i44 = r44, i45 = r45, i46 = r46, i47 = r47, i48 = r48, i49 = r49,
                  R45 = R45_wg, R46 = R46_wg, R47 = R47_wg, R48 = R48_wg, R49 = R49_wg)
#> Info: calculating abundance ratios R[i] = i / 44