wtreg | R Documentation |
Use weighted regression to reduce effects of tidal advection on dissolved oxygen time series
wtreg(
dat_in,
DO_obs = "DO_obs",
depth_val = "Tide",
wins = list(4, 12, NULL),
tz,
lat,
long,
progress = FALSE,
parallel = FALSE,
sine = F,
...
)
dat_in |
input data frame |
DO_obs |
name of dissolved oxygen column |
depth_val |
name of tidal height column |
wins |
list of half-window widths to use in the order specified by |
tz |
chr string specifying timezone of location, e.g., 'America/Jamaica' for EST, no daylight savings, must match the time zone in |
lat |
numeric for latitude of location |
long |
numeric for longitude of location (negative west of prime meridian) |
progress |
logical if progress saved to a txt file names 'log.txt' in the working directory |
parallel |
logical if regression is run in parallel to reduce processing time, requires a parallel backend outside of the function |
sine |
logical if a sinusoidal curve is used in the regression |
... |
additional arguments passed to |
See the supplied dataset for required input data. The wtreg
function only requires date/time, dissolved oxygen, and tidal height columns.
Timezone specifications can be found here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
The original data frame with additional columns describing the metabolic day, decimal time, the slope estimate for DO relative to tidal height for each window (Beta2
), predicted DO from weighted regression (DO_prd
) and detided (normalized) DO from weighted regression (DO_nrm
).
## Not run:
data(SAPDC)
tz <- 'America/Jamaica'
lat <- 31.39
long <- -81.28
res <- wtreg(SAPDC, tz = tz, lat = lat, long = long)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.