Learn R Programming

SWMPr (version 2.1.0)

aggremetab: Aggregate metabolism data

Description

Aggregate a metabolism attribute from swmpr data by a specified time period and method

Usage

aggremetab(swmpr_in, ...)

## S3 method for class 'swmpr':
aggremetab(swmpr_in, by = "weeks", na.action = na.pass,
  alpha = 0.05, ...)

Arguments

swmpr_in
input swmpr object
...
additional arguments passed to other methods
by
chr string of time period for aggregation one of 'years', 'quarters', 'months', 'weeks', 'days', or 'hours'
na.action
function for treating missing data, default na.pass
alpha
numeric indicating alpha level of confidence interval for aggregated data

Value

  • Returns an aggregated metabolism data.frame if the metabolism attribute of the swmpr object is not NULL.

concept

analyze

Details

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.

See Also

aggregate, aggreswmp, ecometab, plot_metab

Examples

Run this code
## 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)

Run the code above in your browser using DataLab