Objects from the Class
Objects can be created by calls of the form new("magpie", data, dim, dimnames, ...)
.
MAgPIE objects have three dimensions (cells,years,datatype) and the dimensionnames
of the first dimension have the structure "REGION.cellnumber".
MAgPIE-objects behave the same like array-objects 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 full regions just by typing x["REGIONNAME",,]
. Please mind following standards:
Header must not contain any purely numeric entries, but combinations of characters and numbers are allowed (e.g. "bla","12" is forbidden, wheras "bla","b12" is allowed)
Years always have the structure "y" + 4-digit number, e.g. "y1995"
Regions always have the structure 3 capital letters, e.g. "AFR" or "GLO"
This standards are necessary to allow the scripts to detect headers, years and regions properly and
to have a distinction to other data.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 = "magpie")
: An extended []-syntax preventing the
collapsing of the array to less than 3 dimenions and allowing the direct access of regions by typing x["REGIONNAME",,]
. In addition drop=TRUE will collapse the dimension within the 3 main categories, pmatch will allow for partial matches accessing the data (pmatch=TRUE will apply a general partial match, pmatch="left" will apply a partial match where the matching has to be at the beginning and for pmatch="right" the match has to be at the end of the string) and invert=TRUE will return the inverse subset of your query. - Obs
signature(e1 = "magpie", e2 = "magpie")
: This method allows to use basic arithmetic calculations such as + or * with MAgPIE objects.