'pems' object structure

Description

This pages provides a brief outview description of the 'pems' object structure. It also lists some associated functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
pemsElement(element, pems=NULL, ..., 
          fun.name = "pemsElement", if.missing = "stop",
          element.name = deparse(substitute(element)))

pemsData(pems=NULL, ..., 
          fun.name = "pemsData", if.missing = "stop",
          pems.name = deparse(substitute(pems)))

pemsConstants(pems=NULL, ..., 
          fun.name = "pemsConstants", if.missing = "stop",
          pems.name = deparse(substitute(pems)))

pemsHistory(pems=NULL, ..., 
         fun.name = "pemsHistory", if.missing = "stop",
         pems.name = deparse(substitute(pems)))

Arguments

element

(A required pems element) For pemsElement, the required data element (data series in data).

pems

(pems object) If supplied, the pems object to search for element before checking the parent environments and R workspace.

...

(Optional) Other Arguments, currently ignored.

fun.name, if.missing, element.name, pems.name

(Various) Other options using for pems.utils house-keeping. See check... for definitions, although generally these can be ignored by users. See Note below.

Details

The pems object is a managed data.frame. It has five main components: data, units, constants, history and tags. data is the main data.frame. Each element (named data.frame column) is a data-series of the original PEMS data. units are the associated unit definitions. constants is a list of associated constants that are to be used with the pems object. (The preference order is arguments given in a call then constants declared in the pems object then constant defaults held by the pems.utils package.) history is a log of pems object modifications. tags are any other components that the user wishes to add to a pems object as identifiers.

pemsElement gets a requested data element.

pemsData gets the data component of a supplied pems object.

pemsConstants gets all constants locally defined for the the supplied pems object.

pemsHistory gets the history of supplied pems object.

Value

pemsElement returns the requested element of a supplied pems object as a managed vector or pems.element, if available. (If missing, error handling is managed by if.missing. See check... for more details.)

pemsData returns the data component of a supplied pems object as a data.frame.

pemsConstants returns the constants component of a supplied pems object as a list.

pemsHistory returns the history component of a supplied pems object as a list.

Note

pems... functions are in development pems object handlers. They are intended for convenient 'front of house' use. As part of this role, their structure will evolve over time, so arguments and operations may change based on user feedback. Those wishing to develop future-proof third party functions should also consider check... functions when developing their code. See common.calculations for some Examples.

Author(s)

Karl Ropkins

References

References in preparation.

See Also

See Also: check... for check... function equivalents; pems.generics for pems object class generic functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
###########
##example 1 
###########

#basic usage

#using example data pems.1
#(supplied as part of pems.utils pacakage)

#pems structure
pems.1

#the pems.1 element velocity
pemsElement(velocity, pems.1)

#check... equivalent
#checkInput(velocity, pems.1)

#generic equivalents
#pems.1$velocity
#pems.1["velocity"]
#etc