This function calculates peak backgrounds from a chromatographic trace with peak table data (see iso_combine_raw_data_with_peak_table).
calculate_backgrounds( data, method, signal_pattern = "^[vi]\\d+", bg_suffix = "_bgrd", time = default("time"), peak = default("peak"), bgrd = default("bgrd"), file = default("file"), quiet = default("quiet") )
| data | the data frame with chromatographic and peak information | 
|---|---|
| method | what method to use to calculate backgrounds (backgrounds are ALWAYS based solely on time points marked as background) run_const = constant background averaged across entire run run_linear = linear background across run @FIXME NOT IMPELEMENTED YET peak_const = constant background across single peak @FIXME NOT IMPELEMENTED YET peak_linear = linear background across peak @FIXME NOT IMPELEMENTED YET | 
| signal_pattern | pattern for signal columns (by default detects voltages starting with e.g. v45 and currents starting with e.g. i45) | 
| bg_suffix | the suffix for the new background columns | 
| time | column name of the time column to use to find peak centers | 
| peak | column name of the peak id column that identifies different peaks | 
| file | column name of the filename column | 
data frame with new signal columns with bg_suffix added, as well as a p.calc_bgrd_method
perhaps implement possibilty to pass with an actual function as method that takes the sub data frame as parameter?