Learn R Programming

ncdf4.helpers (version 0.3-7)

nc.get.variable.list: Get a list of names of data variables

Description

Get a list of names of data variables.

Usage

nc.get.variable.list(f, min.dims = 1)

Value

A character vector naming all of the data variables found.

Arguments

f

The file (an object of class ncdf4)

min.dims

The minimum number of dimensions a variable must have to be included.

Details

This function returns the names of any data variables found in the file -- that is, variables which are NOT dimension variables, dimension bounds variables, climatology bounds variables, coordinate variables, or grid mapping variables.

Optionally, one may require that the variables have a minimum number of dimensions; this can eliminate unwanted variables left in files.

Examples

Run this code
## Get dimension axes from file by inferring them from dimension names
if (FALSE) {
f <- nc_open("pr.nc")
var.list <- nc.get.variable.list(f)
nc_close(f)
}

Run the code above in your browser using DataLab