getExpResid | R Documentation |
Computes residuals from a linear regression using the first order decay function as defined in Helms et al. 2008, Limnol. Oceanogr., 53(3), 955-969. Function assumes that the column names of the absorbance data file being used are formatted as grnumbers.
getExpResid(wavelength, rangeReg, rangeGap, dataAbs, waveCol, colSubsetString, dataSummary, grnum, plotResid = FALSE)
wavelength |
absorbance numeric wavelength |
rangeReg |
numeric string with absorbance wavelength range to be considered for computing spectral slope |
rangeGap |
numeric string with the absorbance wavelength range for which decay function should be applied |
dataAbs |
dataframe with absorbance spectra results, one column per sample, and one column containing the wavelength at which an absorbance measurment is made. |
waveCol |
character column name to define the wavelengths for which absorbance was measured |
colSubsetString |
unique characters to identify which columns contain absorbance data. The default is "gr" to comply with the common naming from the CA WSC. The sample names must begin with 1-n characters for the function to work. |
dataSummary |
dataframe with summary absorbance and fluoresence data. This function adds columns to the end of this dataframe as additional summary data. |
grnum |
character column name that defines the column with sample names in the dataSummary dataframe. |
plotResid |
boolean variable indicating wether plots of the absorbance coefficients with the regression result should be plotted. |
dataframe with the added spectral slope for each sample and plots with the absorbance spectra for rangeReg showing the model constructed using the spectral slope (red); and the absorbance data where black = the data in rangeReg that is not in rangeGap and blue = the data from rangeGap.
wavelength <- 267 rangeReg <- c(240,340) rangeGap <- c(255,300) dataAbs <- dfabs waveCol <- "wavelengths" colSubsetString <- "gr" dataSummary <- dfsummary grnum <- "GRnumber" testdfOpt <- getExpResid(wavelength,rangeReg,rangeGap,dataAbs,waveCol, colSubsetString,dataSummary,grnum)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.