Append mass spectrometer metadata to the raw data.

add_info(.data, .info, cols = NULL, ..., quiet = NULL)

Arguments

.data

A tibble, resulting from collapse_cycles().

.info

A tibble, resulting from clean_did_info().

cols

A character vector with column names in info to add to the data.

...

These dots are for future extensions and must be empty.

quiet

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

Value

Same as .data but with new columns in cols.

See also

dplyr::left_join() for the function that does the matching.

Other metadata cleaning functions: clean_did_info(), get_inits(), parse_info()

Examples

# generate some artificial data
dat <- tibble::tibble(file_id = c("hi", "bye"), Analysis = c(1, 2))
# and artificial metadata
inf <- tibble::tibble(file_id = c("hi", "bye"), Analysis = c(1, 2),
                      file_path = c("/path/to/file", "/path/to/file"),
                      weight = c(69, 87), )
dat <- dat |>
  add_info(inf, c("weight", "file_path"))
#> Info: appending measurement information.