This function will remove names in the data dimension which are the same for each element (meaning that this data dimension contains exactly one element)
collapseNames(x, collapsedim = NULL)
MAgPIE object
If you want to remove the names of particular dimensions provide the dimensions here. Since the function only works in the third dimension, you have to count from there on (e.g. dim = 3.2 refers to collapsedim = 2). Default: NULL. CAUTION with parameter collapsedim! You could also force him to remove dimnames, which are NOT the same for each element and so create duplicates in dimnames.
The provided MAgPIE object with collapsed names
# NOT RUN {
x <- new.magpie("GLO",2000,c("bla.a","bla.b"))
print(x)
# An object of class "magpie"
# , , bla.a
# y2000
# GLO.1 NA
# , , bla.b
# y2000
# GLO.1 NA
print(collapseNames(x))
# An object of class "magpie"
# , , a
# y2000
# GLO.1 NA
# , , b
# y2000
# GLO.1 NA
print(collapseNames(x), collapseNames = 2)
# An object of class "magpie"
# , , bla
# y2000
# GLO.1 NA
# , , bla
# y2000
# GLO.1 NA
# }
Run the code above in your browser using DataLab