nc.get.dim.for.axis: Get dimension corresponding to a given axis

Description Usage Arguments Details Value Examples

View source: R/helpers.r

Description

Get dimension corresponding to a given axis.

Usage

1

Arguments

f

The file (an object of class ncdf4)

v

The source variable: a string naming a variable in a file or an object of class ncvar4.

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

1
2
3
4
5
6
7
## 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)

ncdf4.helpers documentation built on Oct. 15, 2021, 5:19 p.m.