Learn R Programming

openair (version 0.3-25)

openair.class: Generic functions for handling openair outputs

Description

Many openair functions generate outputs of class "openair". These can be manipulated using generic functions like print, plot and summary in a similar fashion to objects of other R classes.

Usage

## S3 method for class 'openair':
names(x, ...)

## S3 method for class 'openair':
summary(object, subset = "all", ...)

## S3 method for class 'openair':
plot(x, subset = "all", silent = TRUE, ...)

## S3 method for class 'openair':
print(x, silent = FALSE, plot = TRUE, ...)

Arguments

x, object
Object. For direct use of print, plot, summary, etc, must be an output from an openair function of class ``openair''.
subset
If x (or object in summary) is a multiple component openair output, the subset of x (or object to use. Default "all" or alternative NULL extract and use all
silent
Logical (TRUE/FALSE). Print output descriptions to console, default TRUE.
plot
Logical (TRUE/FALSE). For print, plot graphical components of x using plot (or more strictly plot.openair, default TRUE.
...
Addition options, typically passed to associated default method(s).

Value

  • Generic functions provide appropriate (conventional) handling of openair function outputs, or objects of ``openair'' class: plot(x) reproduces the original plot. If the original plot contains multiple components, the option subset can be used to produce subplots individually. print(x) provides a (to console) description of x and reproduces the associated plot. As with plot, if x has multiple components, subset can be used to access individual subsets of data and associated plots. summary(object) summarises data in object. If object contains more than data frame, each data frame is summarised individually and results returned as a list of summaries. Alternatively, the option subset can be used to extract one or more data frame to be summarised.

Examples

Run this code
#make object
ans <- trendLevel(mydata, pollutant = "nox")

#use generics
print(ans)

#recover data
results <- ans$data
head(results)

Run the code above in your browser using DataLab