calc_ratios: calc_ratios

Description Usage Arguments Value

View source: R/calculate_ratios.R

Description

Calculates diagnostic ratios and compares them to known source ratios. Double ratio plots are then used to calculate the distance between source and sample. All double ratio Euclidean distances between source and sample are averaged by source to calculate a mean distance between sample and source.

Usage

1
calc_ratios(pah_dat, sample_column = "sample_id", conc_column)

Arguments

pah_dat

dataframe with PAH concentrations, where there is one column of compounds, and each sample is contained in a column. If individual samples are to be averaged before computation, the user should supply the average values. The dataframe must contained a column named 'casrn' which contains the casrn numbers for each compound. Samples below detection limit should be coded as "0" in the concentration column. The function removes any samples that report a 0 for any of the compounds required to calculate ratios.

sample_column

name of the column that contains your unique sample identifier

conc_column

name of the column that contains the results (concentrations)

Value

A data frame that contains a column 'sample_id' which contains the original sample identifiers, as well as the unique identifiers of each source contained in 'source_profiles'. The source and sample ratios are defined in the 'sample_type' column which is defined as either 'source' or 'sample'. Additionally, four columns of ratios are included: Anth_AnthPhen (ratio of anthracene to anthracene plus phenanthrene), Flua_FluaPyr (ratio of fluoranthene to fluoranthene plus pyrene), Baa_BaaCh (ratio of benzo(a)anthracene to benzo(a)anthracene plus chrysene), Indpy_IndpyBghip (ratio of indeno(1,2,3-cd)pyrene to indeno(1,2,3-cd)pyrene plus benzo(g,h,i)perylene).


limnoliver/pah documentation built on April 30, 2020, 2:45 p.m.