plot_metab: Plot ecosystem metabolism for a swmpr object

Description Usage Arguments Details Value See Also Examples

View source: R/swmpr_analyze.R

Description

Plot gross production, total respiration, and net ecosystem metabolism for a swmpr object.

Usage

1
2
3
4
5
plot_metab(swmpr_in, ...)

## S3 method for class 'swmpr'
plot_metab(swmpr_in, by = "months", alpha = 0.05,
  width = 10, pretty = TRUE, ...)

Arguments

swmpr_in

input swmpr object

...

arguments passed to or from other methods

by

chr string describing aggregation period, passed to aggremetab. See details for accepted values.

alpha

numeric indicating alpha level for confidence intervals in aggregated data. Use NULL to remove from the plot.

width

numeric indicating width of top and bottom segments on error bars

pretty

logical indicating use of predefined plot aesthetics

Details

A plot will only be returned if the metabolism attribute for the swmpr object is not NULL. Daily metabolism estimates are also aggregated into weekly averages. Accepted aggregation periods are 'years', 'quarters', 'months', 'weeks', and 'days' (if no aggregation is preferred).

By default, pretty = TRUE will return a ggplot object with predefined aesthetics. Setting pretty = FALSE will return the plot with minimal modifications to the ggplot object. Use the latter approach for easier customization of the plot.

Value

A ggplot object which can be further modified.

See Also

aggremetab, ecometab

Examples

 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
## 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)

## plot
plot_metab(res)

## change alpha, aggregation period, widths
plot_metab(res, by = 'quarters', alpha = 0.1, widths = 0)

## plot daily raw, no aesthetics
plot_metab(res, by = 'days', pretty = FALSE)

## note the difference if aggregating with a moving window average
plot_metab(res, by = 30)

## End(Not run)

SWMPr documentation built on Feb. 9, 2018, 6:08 a.m.

Related to plot_metab in SWMPr...