wtobjfun | R Documentation |
An objective function to minimize plus weighted regression for finding optimal window widths
wtobjfun(
wins,
dat_in,
tz,
lat,
long,
metab_obs,
strt = NULL,
vls = c("meanPg", "sdPg", "anomPg", "meanRt", "sdRt", "anomRt"),
parallel = F,
progress = T
)
wins |
list of half-window widths to use in the order specified by |
dat_in |
input data frame |
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) |
metab_obs |
A |
strt |
a |
vls |
chr vector of summary evaluation object to optimize, see details for |
parallel |
logical if regression is run in parallel to reduce processing time, requires a parallel backend outside of the function |
progress |
logical if progress saved to a txt file names 'log.txt' in the working directory |
A single numeric value to minimize, as output from objfun
objfun
, winopt
## Not run:
library(foreach)
library(doParallel)
data(SAPDC)
tz <- 'America/Jamaica'
lat <- 31.39
long <- -81.28
metobs <- ecometab(SAPDC, DO_var = 'DO_obs', tz = tz, lat = lat, long = long)
ncores <- detectCores()
cl <- makeCluster(ncores)
registerDoParallel(cl)
wtobjfun(SAPDC, tz = tz, lat = lat, long = long, metab_obs = metobs, strt = Sys.time(),
wins = list(6, 6, 0.5), parallel = T)
stopCluster(cl)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.