[[.CFDataset {ncdfCF} | R Documentation |
Get a variable or axis object from a data set
Description
This method can be used to retrieve a variable or axis from the data set by name.
Usage
## S3 method for class 'CFDataset'
x[[i]]
Arguments
x |
An |
i |
The name of a variable or axis in |
Details
If the data set has groups, the name i
of the variable or axis should be
fully qualified with the path to the group where the object is located. This
fully qualified name can be retrieved with the names()
and dimnames()
functions, respectively.
Value
An instance of CFVariable
or an CFAxis
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.6.1 Index]