getRelDiff: getRelDiff

View source: R/getRelDiff.R

getRelDiffR Documentation

getRelDiff

Description

Computes relative differences from optical data. Assumes that the signal with the greatest mean is in the numerator making the mean ratio greater than one.

Usage

getRelDiff(dataSummary, sigs, grnum, specifyOrder = FALSE,
  recordOrder = FALSE, ratioVars = FALSE)

Arguments

dataSummary

dataframe with summary absorbance and fluoresence data.

sigs

signals vector of variable names in dataSummary for generating ratios

grnum

character column name that defines the column with sample names in the dataSummary dataframe. These names are used to merge spectral slope data into the summary dataframe.

specifyOrder

boolean variable to signify whether the numerator and denominator shold stay as specified in ratioVars

recordOrder

boolean variable to signify whether the numerator and denominator order should be recorded and used as output rather than the actual ratios.

ratioVars

dataframe with specific ratios specified. Numerators in the first column and denominators in the second column

Value

dataSummary dataframe with the additional columns of spectral ratios computed using getRatios

Examples

dataSummary <- dfsummary
sigs <- ratioSignals[which(ratioSignals[2]>0),1]
grnum <- "GRnumber"
test <- getRelDiff(dataSummary,sigs,grnum)

USGS-R/USGSHydroOpt documentation built on Oct. 18, 2022, 9:50 a.m.