This function combines chromatogram and peak table information and is used internally in several plotting and peak table calculation functions. Usually it is not called directly by the user but may be of use for extending functionality and is hence provided as a stand-alone function.

iso_combine_raw_data_with_peak_table(
  raw_data,
  peak_table,
  file_id = default(file_id),
  data_trace = NULL,
  rt = default(rt),
  rt_start = default(rt_start),
  rt_end = default(rt_end),
  rt_unit = NULL
)

Arguments

raw_data

the raw chromatographic data. If in long format, data_trace must be set to identify peaks correctly with the individual data traces.

peak_table

a data frame that describes the peaks in this chromatogram. Peaks must have at minimum an apex retention time or a start and end retention time (ideally all 3). If no apex retention time is provided, peak marker points cannot be identified. If not both start and end retention time are provided, peak start and end are identified to lie right before and after the apex point.

file_id

the column (or columns) that uniquely identifies individual analyses for proper matching of the raw chromatography data with the peak_table data. In most cases dealing with isoreader data, the default (file_id) should work fine.

data_trace

expression to identify individual data traces for raw data in long format. This is not usually needed for calculations but can be useful when working with data frames already gathered for plotting. If the data is indeed in gathered (long) format, and this is not set correctly, peak table data is integrated across all traces in the raw data leading to unpredictable peak border and apex identifications.

rt

the column in the peak_table that holds the retention time of the peak.

rt_start

the column in thepeak_table that holds the retention time where each peak starts.

rt_end

the column in thepeak_table that holds the retention time where each peak ends.

rt_unit

which time unit the retention time columns (rt, rt_start, rt_end) are in. Only required if the retention time columns are not iso_double_with_units columns and are not in the same unit as the time column of the raw data. If provided, will override column units.