nc.get.dim.axes {ncdf4.helpers} | R Documentation |
Get dimension axes
Description
Get dimension axes for the given variable.
Usage
nc.get.dim.axes(f, v, dim.names)
Arguments
f |
The file (an object of class |
v |
The name of a variable |
dim.names |
Optionally, dimension names (to avoid looking them up repeatedly) |
Details
This function returns the dimension axes for a given variable as a named character vector; the names are the names of the corresponding dimensions. If no variable is supplied, the function will return data for all dimensions found in the file.
Axes are X, Y, Z (depth, plev, etc), T (time), and S (space, for reduced grids).
This routine will attempt to infer axes for dimensions if no 'axis' attribute is found on a dimension variable, using the nc.get.dim.axes.from.names function.
Value
A named character vector mapping dimension names to axes.
Examples
## Get dimension axes from file.
## Not run:
f <- nc_open("pr.nc")
## Get dim axes for a specified variable
dim.axes <- nc.get.dim.axes(f, "pr")
## Get all dim axes in file
dim.axes <- nc.get.dim.axes(f)
nc_close(f)
## End(Not run)
[Package ncdf4.helpers version 0.3-6 Index]