-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwtreg.Rd
66 lines (52 loc) · 2.13 KB
/
wtreg.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wtreg.R
\name{wtreg}
\alias{wtreg}
\title{Weighted regression for dissolved oxygen time series}
\usage{
wtreg(
dat_in,
DO_obs = "DO_obs",
depth_val = "Tide",
wins = list(4, 12, NULL),
tz,
lat,
long,
progress = FALSE,
parallel = FALSE,
sine = F,
...
)
}
\arguments{
\item{dat_in}{input data frame}
\item{DO_obs}{name of dissolved oxygen column}
\item{depth_val}{name of tidal height column}
\item{wins}{list of half-window widths to use in the order specified by \code{\link{wtfun}} (i.e., days, hours, tide height).}
\item{tz}{chr string specifying timezone of location, e.g., 'America/Jamaica' for EST, no daylight savings, must match the time zone in \code{dat_in$DateTimeStamp}}
\item{lat}{numeric for latitude of location}
\item{long}{numeric for longitude of location (negative west of prime meridian)}
\item{progress}{logical if progress saved to a txt file names 'log.txt' in the working directory}
\item{parallel}{logical if regression is run in parallel to reduce processing time, requires a parallel backend outside of the function}
\item{sine}{logical if a sinusoidal curve is used in the regression}
\item{...}{additional arguments passed to \code{\link{met_day_fun}}, particularly timezone, lat, and long information.}
}
\value{
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 (\code{Beta2}), predicted DO from weighted regression (\code{DO_prd}) and detided (normalized) DO from weighted regression (\code{DO_nrm}).
}
\description{
Use weighted regression to reduce effects of tidal advection on dissolved oxygen time series
}
\details{
See the supplied dataset for required input data. The \code{\link{wtreg}} function only requires date/time, dissolved oxygen, and tidal height columns.
Timezone specifications can be found here: \url{https://en.wikipedia.org/wiki/List_of_tz_database_time_zones}
}
\examples{
\dontrun{
data(SAPDC)
tz <- 'America/Jamaica'
lat <- 31.39
long <- -81.28
res <- wtreg(SAPDC, tz = tz, lat = lat, long = long)
}
}