trefoil-class: Class "trefoil" ~~~

Description Usage Arguments Objects from the Class Slots Extends Methods Author(s) Examples

Description

The trefoil class is a data format for spatio-temporal data which is closely linked to the array class definition. In contrast to arrays the trefoil class always distinguished between spatial, temporal and other dimensions. The objects are always 3D merging all spatial dimensions in the first dimension, temporal dimensions in the second and everything else in the third dimension. is.trefoil tests if x is an Trefoil-object, as.trefoil transforms x to an trefoil object (if possible).

Usage

1
2

Arguments

x

An object that should be either tested or transformed as/to an trefoil object.

...

additional arguments supplied for the conversion to a trefoil object. Allowed arguments for arrays and dataframes are spatial and temporal both expecting a vector of dimension or column numbers which contain the spatial or temporal information. By default both arguments are set to NULL which means that the as.trefoil will try to detect automatically the temporal and spatial dimensions. The arguments will just overwrite the automatic detection. In addition as.trefoil for data.frames is also expecting an argument called datacol which expects a number stating which is the first column containing data. This argument should be used if the dimensions are not detected corretly, e.g. if the last dimension column contains years which are then detected as values and therefore interpreted as first data column.

Objects from the Class

Objects can be created by calls of the form new("trefoil", data, dim, dimnames, ...). trefoil objects have three dimensions (spatial,temporal,datatype). trefoils behave the same like arrays with 2 exceptions:
1.Dimensions of the object will not collapse (e.g. x[1,1,1] will remain 3D instead of becoming 1D)
2.It is possible to extract subentries of a dimension just by typing its name (e.g. x["REGION_X",,] will extract all data for region_x).

Slots

.Data:

Object of class "array" ~~

Extends

Class "array", from data part. Class "structure", by class "array", distance 2. Class "matrix", by class "array", distance 2, with explicit test and coerce. Class "vector", by class "array", distance 3, with explicit coerce. Class "vector", by class "array", distance 5, with explicit test and coerce.

Methods

[

signature(x = "trefoil"): An extended []-syntax preventing the collapsing of the array to less than 3 dimensions and allowing the direct access of subentries.

Obs

signature(e1 = "trefoil", e2 = "trefoil"): This method allows to use basic arithmetic calculations such as + or * with trefoils.

Author(s)

Jan Philipp Dietrich

Examples

1
showClass("trefoil")

pik-piam/trefoil documentation built on Nov. 5, 2019, 12:50 a.m.