ncdfDimnames {ncdfCF} | R Documentation |
ncdfObject
instanceRetrieve the dimension names of an ncdfCF
object. The return
value differs depending on the type of object:
ncdfDataset
, ncdfVariable
: The dimnames are returned as a vector of the
names of the dimensions of the dataset or variable. Note that this differs
markedly from the base::dimnames()
functionality.
ncdfDimensionNumeric
: The values of the elements along the dimension as a
numeric vector.
ncdfDimensionCharacter
: The values of the elements along the dimension as
a character vector.
ncdfDimensionTime
: The values of the elements along the dimension as a
character vector containing timestamps in ISO8601 format. This could be dates
or date-times if time information is available in the dimension.
## S4 method for signature 'ncdfVariable'
dimnames(x)
## S4 method for signature 'ncdfDataset'
dimnames(x)
## S4 method for signature 'ncdfDimensionCharacter'
dimnames(x)
## S4 method for signature 'ncdfDimensionNumeric'
dimnames(x)
## S4 method for signature 'ncdfDimensionTime'
dimnames(x)
x |
An |
A vector as described in the Description section.
fn <- system.file("extdata",
"pr_day_EC-Earth3-CC_ssp245_r1i1p1f1_gr_20240101-20241231_vncdfCF.nc",
package = "ncdfCF")
ds <- open_ncdf(fn)
# ncdfDataset
dimnames(ds)
# ncdfVariable
pr <- ds[["pr"]]
dimnames(pr)
# ncdfDimensionNumeric
lon <- ds[["lon"]]
dimnames(lon)
# ncdfDimensionTime
t <- ds[["time"]]
dimnames(t)