View source: R/CST_ChangeDimNames.R
CST_ChangeDimNames | R Documentation |
Change the names of the dimensions specified in 'original_names' to the names in 'new_names'. The coordinate names and the dimensions of any attributes are also modified accordingly.
CST_ChangeDimNames(data, original_names, new_names)
data |
An object of class |
original_names |
A single character string or a vector indicating the dimensions to be renamed. |
new_names |
A single character string or a vector indicating the new dimension names, in the same order as the dimensions in 'original_names'. |
An object of class s2dv_cube
with similar data, coordinates and
attributes as the data
input, but with modified dimension names.
Agudetse Roures Victoria, victoria.agudetse@bsc.es
# Example with sample data:
# Check original dimensions and coordinates
lonlat_temp$exp$dims
names(lonlat_temp$exp$coords)
dim(lonlat_temp$exp$attrs$Dates)
# Change 'dataset' to 'dat' and 'ftime' to 'time'
exp <- CST_ChangeDimNames(lonlat_temp$exp,
original_names = c("dataset", "ftime"),
new_names = c("dat", "time"))
# Check new dimensions and coordinates
exp$dims
names(exp$coords)
dim(exp$attrs$Dates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.