Learn R Programming

ncdfCF (version 0.1.1)

dimlength: 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 ncdfVariable
dim(x)

# S4 method for ncdfDataset dim(x)

Value

Named integer vector of dimension sizes of dimensions in x.

Arguments

x

An instance of ncdfDataset or ncdfVariable.

Examples

Run this code
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"]])

Run the code above in your browser using DataLab