nc.get.var.subset.by.axes: Gets a data subset in the place described by the named list...

View source: R/helpers.r

nc.get.var.subset.by.axesR Documentation

Gets a data subset in the place described by the named list of axes

Description

Gets a data subset in the place described by the named list of axes.

Usage

nc.get.var.subset.by.axes(f, v, axis.indices, axes.map = NULL)

Arguments

f

An object of class ncdf4 which represents a NetCDF file.

v

A string naming a variable in a file or an object of class ncvar4.

axis.indices

A list consisting of zero or more vectors of indices, named by which axis they refer to (X, Y, T, etc).

axes.map

An optional vector mapping axes to NetCDF dimensions. If not supplied, it will be generated from the file.

Details

This function will read data from the specified file (f) and variable (v) at the location specified by axis.indices.

See Also

ncdf4.helpers-package

Examples

## Get a subset of the data.
## Not run: 
f <- nc_open("pr.nc")
dat <- nc.get.var.subset.by.axes(f1, "pr", list(X=1:4, Y=c(1, 3, 5)))
nc_close(f)

## End(Not run)


ncdf4.helpers documentation built on April 12, 2025, 1:39 a.m.