| addDim | R Documentation |
This function adds a named dimension as dimension number "dim" with the name "dimName" with an empty data column with the name "item".
addDim(x, dim = 3.1, dimName = NULL, item = "dummy", expand = TRUE)
x |
MAgPIE object which should be extended. |
dim |
The dimension number of the new dimension (e.g. 3.1) |
dimName |
The name of the new dimension |
item |
One or more names of items in the new dimension. If more than one is given, behavior depends on the expand argument. |
expand |
If TRUE, each item from the item argument is added to each item already present, resulting in e.g. 'c("A.d1", "B.d1", "A.d2", "B.d2")'. Otherwise, length of item must equal the number of items already present and they are simply added, resulting in e.g. 'c("A.d1", "B.d2")'. |
The extended MAgPIE object
Jan Philipp Dietrich, Benjamin Bodirsky, Pascal Sauer
add_columns,mbind
Other DimensionManipulation:
add_columns(),
collapseDim(),
collapseNames(),
dimCode(),
dimOrder(),
dimReduce()
a <- maxample("animal")
str(addDim(a, dim = 3.2))
str(addDim(a, dim = 2.3, item = paste0("d", 1:3)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.