nc.get.dim.for.axis {ncdf4.helpers} | R Documentation |
Get dimension corresponding to a given axis
Description
Get dimension corresponding to a given axis.
Usage
nc.get.dim.for.axis(f, v, axis)
Arguments
f |
The file (an object of class |
v |
The source variable: a string naming a variable in a file or an object of class |
axis |
The axis to retrieve the dimension for: a string consisting of either X, Y, Z, T, or S. |
Details
This function returns the dimension (of class 'ncdim4') corresponding to the specified axis (X, Y, Z, T, or S).
Value
An object of class ncdim4
if a dimension is found for the specified axis; NA
otherwise.
Examples
## Get dimension for X axis
## Not run:
f <- nc_open("pr.nc")
x.axis.dim <- nc.get.dim.axes.from.names(f, "pr", "X")
nc_close(f)
## End(Not run)
[Package ncdf4.helpers version 0.3-6 Index]