names.CFDataset {ncdfCF}R Documentation

Names or dimension values of an CF object

Description

Retrieve the variable or dimension names of an ncdfCF object. The names() function gives the names of the variables in the data set, prepended with the path to the group if the resource uses groups. The return value of the dimnames() function differs depending on the type of object:

Usage

## S3 method for class 'CFDataset'
names(x)

groups(x)

## S3 method for class 'CFDataset'
groups(x)

Arguments

x

An CFObject whose axis names to retrieve. This could be CFDataset, CFVariable, or a class descending from CFAxis.

Value

A vector as described in the Description section.

Examples

fn <- system.file("extdata",
  "pr_day_EC-Earth3-CC_ssp245_r1i1p1f1_gr_20230101-20231231_vncdfCF.nc",
  package = "ncdfCF")
ds <- open_ncdf(fn)

# CFDataset
dimnames(ds)

# CFVariable
pr <- ds[["pr"]]
dimnames(pr)

# CFAxisNumeric
lon <- ds[["lon"]]
dimnames(lon)

# CFAxisTime
t <- ds[["time"]]
dimnames(t)

[Package ncdfCF version 0.6.1 Index]