Learn R Programming

chromConverter (version 0.12.0)

get_element: Get one element of each sample

Description

Extracts the same element from every sample of a chrom_list whose samples are themselves lists, such as the output of read_chroms with several what values (e.g. c("dad", "instrument")). The result has one chromatogram per sample, which packages that expect a list of chromatograms, such as chromatographR, accept as is.

Usage

get_element(x, what)

Value

A list of the extracted chromatograms, with the names and class of x.

Arguments

x

A chrom_list whose samples are lists of elements.

what

The element to extract: a single name (e.g. "dad"), or a vector of names for a nested element (e.g. c("instrument", "PMP1, Pressure")). A nested element can also be written as one string split at the first colon, as in "instrument:PMP1, Pressure", unless that string is itself an element name.

See Also

read_chroms, extract_metadata

Examples

Run this code
path <- system.file("extdata", "benzoxazinoid_standards", "BENZOS_250PPM.D",
                    package = "chromConverter")
run <- read_chroms(path, format_in = "agilent_d",
                   what = c("chroms", "instrument"), progress_bar = FALSE)
pressure <- get_element(run, "instrument:PMP1, Pressure")
head(pressure[[1]])

Run the code above in your browser using DataLab