1.2.pems.structure {pems.utils} | R Documentation |
This pages provides a brief outview description of the 'pems' object structure. It also lists some associated functions
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))) pemsin(x, data=NULL) pemsin2(x, data, units=NULL, .x=enquo(x))
element |
(A required pems element) For |
pems |
(pems object) If supplied, the |
... |
(Optional) Other Arguments, currently ignored. |
fun.name, if.missing, element.name, pems.name |
(Various) Other options using for |
x, data, units, .x |
|
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.
pemsin
is like pemsElement
but uses lazyeval
to do all the hard work.
pemsin2
is like pemsElement
but uses rlang
and dplyr
to do all the hard work.
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
.
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.
Karl Ropkins
References in preparation.
See Also: check...
for check...
function equivalents; pems.generics
for pems
object class generic functions.
########### ##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 ## Not run: pems.1$velocity pems.1["velocity"] #etc ## End(Not run)