ncdfDimnames {ncdfCF}R Documentation

Dimnames of an ncdfObject instance

Description

Retrieve the dimension names of an ncdfCF object. The return value differs depending on the type of object:

Usage

## 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)

Arguments

x

An ncdfObject whose dimension names to retrieve. This could be ncdfDataset, ncdfVariable, ncdfDimensionNumeric or ncdfDimensionTime.

Value

A vector as described in the Description section.

Examples

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)

[Package ncdfCF version 0.1.1 Index]