| add_dimension | R Documentation |
This function adds a named dimension as dimension number "dim" with
the name "add" with an empty data column with the name "nm".
Please start using this function's successor addDim. add_dimension
might eventually become deprecated.
add_dimension(x, dim = 3.1, add = NULL, nm = "dummy", expand = TRUE)
x |
MAgPIE object which should be extended. |
dim |
The dimension number of the new dimension (e.g. 3.1) |
add |
The name of the new dimension |
nm |
One or more names of items in the new dimension. |
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.