Description Usage Arguments Details Value See Also Examples
View source: R/dr_correctTwo.R
A wrapper around dplyr::mutate()
that creates a corrected value for each observation of the
specified variable based on two data points.
1 2 | dr_correctTwo(.data, sourceVar, cleanVar, calValLow, calStdLow,
calValHigh, calStdHigh, factorVar)
|
.data |
A tbl |
sourceVar |
Name of variable to correct |
cleanVar |
New variable name for corrected data |
calValLow |
A numeric value; the number that the instrument was actually reading for the low standard |
calStdLow |
A numeric value; the number that the instrument should have been reading for that standard; i.e. the low standard value |
calValHigh |
A numeric value; the number that the instrument was actually reading for the high standard |
calStdHigh |
A numeric value; the number that the instrument should have been reading for that standard; i.e. the high standard value |
factorVar |
Name of variable generated using |
This command takes the raw data from the water-quality instrument, utilizes the values
generated from dr_factor
and returns data that accounts for drift over time.
This is done via a two-point calibration standard, which it typical for pH and chloride.
An object of the same class as .data
with the new corrected variable added
to the other data in .data
.
dr_factor
for correction factor creation,
dr_correctOne
for the two-point drift correction
1 2 3 4 5 6 7 8 9 10 11 | testData <- data.frame(
Date = c("9/18/2015", "9/18/2015", "9/18/2015", "9/18/2015", "9/18/2015", "9/18/2015"),
Time = c("12:10:49", "12:15:50", "12:20:51", "12:25:51", "12:30:51", "12:35:51"),
Temp = c(14.76, 14.64, 14.57, 14.51, 14.50, 14.63),
pH = c(7.18, 7.14, 7.14, 7.13, 7.13, 7.13),
corrFac = c(0.0000000, 0.2003995, 0.4007989, 0.6005326, 0.8002663, 1.0000000),
stringsAsFactors = FALSE
)
dr_correctTwo(testData, sourceVar = pH, cleanVar = pH_Corr, calValLow = 7.01, calStdLow = 7,
calValHigh = 11.8, calStdHigh = 10, factorVar = corrFac)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.