3.2.generic.pems.element.handlers: Generic handling of pems.element objects

3.2.generic.pems.element.handlersR Documentation

Generic handling of pems.element objects

Description

pems elements objects 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 'pems.element'
 x[i, ..., force = TRUE, wrap = FALSE]

## S3 replacement method for class 'pems.element'
 x[i, ..., force = TRUE, wrap = FALSE] <- value

## S3 method for class 'pems.element'
as.pems(x, ...)

## S3 method for class 'pems.element'
print(x, ..., n = NULL, rows = NULL, width = NULL)

## S3 method for class 'pems.element'
plot(x, y = NULL, xlab = NULL, ylab = NULL, ...)

## S3 method for class 'pems.element'
units(x)

## S3 replacement method for class 'pems.element'
units(x) <- value

## S3 method for class 'pems.element'
summary(object, ...)

## S3 method for class 'pems.element'
round(x, ...)

Arguments

x,object

(An Object of pems.element class). For direct use with print, plot, summary, etc. NOTE: Object naming (i.e., x or object) is determined in parent or base function in R, so naming varies by method.

i

Element indices, which operate in a similar fashion to vector indices.

...

Addition options, typically passed to associated default method(s).

force, wrap

(Logicals) Data element handling options: force forces data to fit it destination; wrap expands data to fit its destination by wrapping the source pems.element.

value

(Vector) For calls in pems.element[1] <- value or units(pems.element) <- value, the value to be inserted.

n, rows, width

(Numerics) For print(pems), number of elements, rows or screen width to foreshorten print output to.

y, xlab, ylab

(other plot arguments). As with the default plot method, y is an optional second data verctor, typically numeric, and xlab and ylab are labels to use on x and y axes.

Value

Generic functions provide appropriate (conventional) handling of objects of 'pems.elements' class:

print(pems.element) provides a (to console) description of the supplied pems.element object.

plot(pems.element) generates a standard R plot of the supplied pems.element.

units(pems.element) extracts the units from the supplied pems.element.

Note

A dedicated round(pems.element) is required as a wrapper to round.Date and round.POSIXt handling.

Author(s)

Karl Ropkins

Examples


#the velocity pems.element in pems.1
pems.1$velocity


pems.utils documentation built on March 31, 2023, 3:01 p.m.