be_visual_data
be_visual_data.Rd
Generate dataset for comparing barometric efficiency
Usage
be_visual_data(
dat,
dep = "wl",
ind = "baro",
be_tests = seq(0, 1, 0.1),
inverse = TRUE
)
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_tests
vector of barometric efficiencies to test (between 0 and 1) (numeric)
- 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).
Examples
library(data.table)
be <- 0.43
x <- seq(0, 28*pi, pi / (12*12))
baro <- sin(x) + rnorm(length(x), sd = 0.04)
wl <- -sin(x) * be + rnorm(length(x), sd = 0.04)
dat <- data.table(datetime = as.POSIXct(x * 86400 / (2 * pi),
origin = '1970-01-01', tz = 'UTC'),
wl = wl, baro = baro)
be_visual_data(dat)
#> datetime wl baro correction corrected
#> <POSc> <num> <num> <num> <num>
#> 1: 1970-01-01 00:00:00 -0.025938114 0.0007664839 0.000000000 -0.025938114
#> 2: 1970-01-01 00:05:00 -0.001305284 -0.0166037299 0.000000000 -0.001305284
#> 3: 1970-01-01 00:10:00 0.008344797 0.0564960216 0.000000000 0.008344797
#> 4: 1970-01-01 00:15:00 -0.013855141 0.0711983903 0.000000000 -0.013855141
#> 5: 1970-01-01 00:20:00 -0.102700199 0.0818402919 0.000000000 -0.102700199
#> ---
#> 44359: 1970-01-14 23:40:00 0.036178964 -0.1200009349 -0.120720944 -0.084541980
#> 44360: 1970-01-14 23:45:00 -0.047273450 -0.0299725796 -0.030692589 -0.077966039
#> 44361: 1970-01-14 23:50:00 0.038812221 -0.0796935625 -0.080413572 -0.041601351
#> 44362: 1970-01-14 23:55:00 -0.036224951 0.0046600739 0.003940065 -0.032284886
#> 44363: 1970-01-15 00:00:00 0.042486360 -0.0311489886 -0.031868998 0.010617362
#> be
#> <num>
#> 1: 0
#> 2: 0
#> 3: 0
#> 4: 0
#> 5: 0
#> ---
#> 44359: 1
#> 44360: 1
#> 44361: 1
#> 44362: 1
#> 44363: 1