wtreg: Weighted regression for dissolved oxygen time series

Description Usage Arguments Details Value Examples

View source: R/wtreg.R

Description

Use weighted regression to reduce effects of tidal advection on dissolved oxygen time series

Usage

1
2
wtreg(dat_in, DO_obs = "DO_obs", depth_val = "Tide", wins = list(4, 12,
  NULL), tz, lat, long, progress = FALSE, parallel = FALSE, ...)

Arguments

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 wtfun (i.e., days, hours, tide height).

tz

chr string specifying timezone of location, e.g., 'America/Jamaica' for EST, no daylight savings

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

...

additional arguments passed to met_day_fun, particularly timezone, lat, and long information.

Details

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

Value

The original data frame with additional columns describing the metabolic day, decimal time, predicted DO from weighted regression (DO_prd) and detided (normalized) DO from weighted regression (DO_nrm).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
data(SAPDC)

tz <- 'America/Jamaica'
lat <- 31.39
long <- -89.28

res <- wtreg(SAPDC, tz = tz, lat = lat, long = long)


## End(Not run)

fawda123/WtRegDO documentation built on June 8, 2017, 2:18 p.m.