extract_data {gcxgclab}R Documentation

Extracts data from cdf file.

Description

extract_data Extracts the data from a cdf file.

Usage

extract_data(filename, mod_t = 10, shift_time = TRUE)

Arguments

filename

a string object. The path or file name of the cdf file to be opened.

mod_t

a float object. The modulation time for the GCxGC sample analysis. Default is 10.

shift_time

a boolean object. Determines whether the Overall Time Index should be shifted to 0. Default is TRUE.

Details

This function opens the specified cdf file using the implemented function nc_open from ncdf4 package, then extracts the data and closes the cdf file using the implemented function nc_close from ncdf4 package (Pierce 2021). It then returns a list of two data frames. The first is a dataframe of the TIC data, the output of create_df(). The second is a data frame of the full MS data, the output of mass_data().

Value

A list object. A list of the extracted data: scan acquisition time, total intensity, mass values, intensity values, and point count.

References

Pierce D (2021). “Interface to Unidata netCDF (Version 4 or Earlier) Format Data Files.” CRAN. https://cirrus.ucsd.edu/~pierce/ncdf/index.html.

Examples

file <- system.file("extdata","sample1.cdf",package="gcxgclab")
frame <- extract_data(file,mod_t=.5)
plot_chr(frame, title='Raw Data', scale="linear")
plot_chr(frame, title='Log Intensity')


[Package gcxgclab version 1.0.1 Index]