be_high_low: be_high_low

Description Usage Arguments Value Examples

View source: R/be_high_low.R

Description

Uses the maximum and minimum values for a time period to calculate be.

Usage

1
2
be_high_low(dat, dep = "wl", ind = "baro", time = "datetime",
  time_group = "%Y-%m-%d")

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.

time

name of the column containing the time (character)

time_group

format for grouping time (ie: "%Y-%m-%d") (character)

Value

barometric efficiency based on high and low values

Examples

1
2
3
4
5
6
7
8
library(data.table)
datetime <- seq.POSIXt(as.POSIXct("2016-01-01 00:00:00", tz = 'UTC'),
                       as.POSIXct("2016-01-06 00:00:00", tz = 'UTC'), by='hour')
baro  <- sin(seq(0, 2*pi, length.out = length(datetime)))
wl    <- 0.4 * baro + rnorm(length(datetime), sd = 0.01)
dat   <- data.table(baro, wl, datetime)
be_hl <- be_high_low(dat)
be_hl <- be_high_low(dat, time_group = 86400)

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