be_correct: be_correct

Description Usage Arguments Value Examples

View source: R/be_correct.R

Description

Adjust values based on the barometric efficiency

Usage

1
2
be_correct(dat, dep = "wl", ind = "baro", be = 0, inverse = TRUE,
  known_mean = NULL)

Arguments

dat

data that has the independent and dependent variables (data.table)

dep

name of the dependent variable column (character). This is typically the name for the column holding your water level data.

ind

name of the independent variable column (character). This is typically the name for the column holding your barometric pressure data.

be

numeric value of the barometric efficiency

inverse

whether the barometric relationship is inverse (TRUE means that when the barometric pressure goes up the measured water level goes down (vented transducer, depth to water), FALSE means that when the barometric pressure goes up so does the measured pressure (non-vented transducer)) (logical).

known_mean

numeric explicitly enter the mean if known. Otherwise estimate from data.

Value

numeric vector of corrected values

Examples

1
2
3
4
5
6
7
library(data.table)
baro = rnorm(1000, sd = 0.01) + 9
wl <- baro * 0.4 + 18
dat <- data.table(baro, wl)
dat$wl + be_correct(dat, be=0.4, inverse = FALSE)
dat$wl + be_correct(dat, be=0.4, inverse = FALSE, known_mean = 9) 
# should return ~21.6 = 18 + 0.4 * 9

jkennel/waterlevel documentation built on Dec. 1, 2019, 6:24 p.m.