add_columns {magclass} | R Documentation |
add_columns
Description
Function adds new columns to the existing magpie object.
Usage
add_columns(x, addnm = "new", dim = 3.1, fill = NA)
Arguments
x |
MAgPIE object which should be extended. |
addnm |
The new elements that should be added to the (sub)dimension |
dim |
The (sub)dimension to be filled either identified via
name or dimension code (see |
fill |
fill value of length 1 for the newly added columns (NA by default) |
Value
The extended MAgPIE object
Author(s)
Jan Philipp Dietrich, Benjamin Bodirsky
See Also
Examples
a <- maxample("animal")
a2 <- add_columns(a, addnm = c("horse", "magpie"), dim = "species", fill = 42)
getItems(a2, dim = 3)
getItems(a2, dim = 3, split = TRUE)
head(a2[, , "magpie"])
[Package magclass version 6.13.2 Index]