powered by
Function adds new columns to the existing magpie object.
add_columns(x, addnm = "new", dim = 3.1, fill = NA)
The extended MAgPIE object
MAgPIE object which should be extended.
The new elements that should be added to the (sub)dimension
The (sub)dimension to be filled either identified via name or dimension code (see dimCode for more information)
dimCode
fill value of length 1 for the newly added columns (NA by default)
Jan Philipp Dietrich, Benjamin Bodirsky
add_dimension,dimCode
add_dimension
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"])
Run the code above in your browser using DataLab