dimlength {ncdfCF}R Documentation

Lengths of dimensions of the data set or variable

Description

With this method the lengths of all dimensions of a dataset or a variable are returned. Note that a dataset may have more dimensions than a variable from the same dataset: other variables may use different dimensions.

Usage

## S4 method for signature 'ncdfVariable'
dim(x)

## S4 method for signature 'ncdfDataset'
dim(x)

Arguments

x

An instance of ncdfDataset or ncdfVariable.

Value

Named integer vector of dimension sizes of dimensions in x.

Examples

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

# ncdfDataset
dim(ds)

# ncdfVariable
dim(ds[["pr"]])

[Package ncdfCF version 0.1.1 Index]