[[,ncdfDataset-method {ncdfCF}R Documentation

Get a variable object or a dimension object from a dataset

Description

This method can be used to retrieve a variable or a dimension from the dataset by name.

Usage

## S4 method for signature 'ncdfDataset'
x[[i]]

Arguments

x

An ncdfDataset to extract a variable or a dimension from.

i

The name of a variable or dimension in x.

Value

An instance of ncdfVariable or an ncdfDimension descendant class, or NULL if the name is not found.

Examples

fn <- system.file("extdata", "ERA5land_Rwanda_20160101.nc", package = "ncdfCF")
ds <- open_ncdf(fn)
v1 <- names(ds)[1]
var <- ds[[v1]]
var

[Package ncdfCF version 0.1.1 Index]