openair (version 0.5-2)

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':
head(x, subset = "all", ...)

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

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

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

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

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

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

Arguments

x, object
An Object. For direct use of print, plot, summary, etc, must be an output from an openair function of class ``openair''. NOTE: Object naming (i.e., x or object) is determined in pare
subset
If x (or object) is a multiple component openair output, the subset of x (or object) to use. Default "all" or alternative NULL extract and use all available subsets.
silent
Logical (TRUE/FALSE). Do not print output descriptions to console.
plot
Logical (TRUE/FALSE). For print, plot graphical components of x using plot, 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(output) reproduces the original plot. If the original plot contains multiple components, the option subset can be used to produce subplots individually. print(output) provides a (to console) description of the output and reproduces the associated plot. As with plot, if the output has multiple components, subset can be used to access individual subsets of data and associated plots. results(output) extracts the data used to generate the openair plot. If the output contains more than one data frame, these are returned as a list of data frames. Alternatively, in such cases the option subset can be used to extract one or more data frame from the supplied object. NOTE: results is not strictly a generic function. The term and mode of operation is not widely used elsewhere in R. It is, however, convenient to consider it alongside the openair.generics because it operates on openair objects and because it has been implemented as method in a similar fashion to the generic terms. The default form of results (that used if object is not of ``openair'' class) currently returns object without modification. summary(output) summarises data in the output. If the output contains more than one data frame, each data frame is summarised individually and results returned as a list of summaries. As above the option subset can be used to extract one or more data frame to be summarised. See summary for details of individual data frame handling. head(output) and tail(output) operate like summary but return the first or last part of available/requested output data frames, respectively, in a similar fashion to conventional R functions head and tail. See head or tail for details of individual data frame handling.

Examples

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

#use generics
print(ans)

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

Run the code above in your browser using DataLab