aggremetab | R Documentation |
Aggregate a metabolism attribute from swmpr data by a specified time period and method
aggremetab(swmpr_in, ...)
## S3 method for class 'swmpr'
aggremetab(swmpr_in, by = "weeks", na.action = na.pass, alpha = 0.05, ...)
swmpr_in |
input swmpr object |
... |
additional arguments passed to other methods |
by |
chr string or numeric value specifying aggregation period. If chr string, must be |
na.action |
function for treating missing data, default |
alpha |
numeric indicating alpha level of confidence interval for aggregated data |
The function summarizes metabolism data by averaging across set periods of observation. Confidence intervals are also returned based on the specified alpha level. It is used within plot_metab
function to view summarized metabolism results. Data can be aggregated by 'years'
, 'quarters'
, 'months'
, or 'weeks'
for the supplied function, which defaults to the mean
. The method of treating NA values for the user-supplied function should be noted since this may greatly affect the quantity of data that are returned.
Returns an aggregated metabolism data.frame
if the metabolism
attribute of the swmpr object is not NULL
. Upper and lower confidence limits are also provided if the aggregation period was specified as a character string.
aggregate
, aggreswmp
, ecometab
, plot_metab
## Not run:
## import water quality and weather data
data(apadbwq)
data(apaebmet)
## qaqc, combine
wq <- qaqc(apadbwq)
met <- qaqc(apaebmet)
dat <- comb(wq, met)
## estimate metabolism
res <- ecometab(dat)
## change aggregation period and alpha
aggremetab(res, by = 'months', alpha = 0.1)
## use a moving window average of 30 days
aggremetab(res, by = 30)
## use a left-centered window instead
aggremetab(res, by = 30, sides = 1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.