get_var_array: Retrieve an array of data from a ncdf object

View source: R/nc.R

get_var_arrayR Documentation

Retrieve an array of data from a ncdf object

Description

Retrieve an array of data from a ncdf object

Usage

get_var_array(x, var, index, collapse_degen = FALSE)

Arguments

x

ncdf4 object

var

variable id (name)

index

named list of [start,length] vectors for each dimension

  • lonsuch as c(1,913)

  • latsuch as c(1,443)

  • timesuch as c(5, 7) which starts on the 5th and ends on the 12th

  • levsuch as c(8,1) which retrieves just the 8th level

collapse_degen

logical, if FALSE then preserve length 1 dimensions NAM218 grib files have variables with either [lon, lat, time] or [lon, lat, lev, time] dimensions. If the grib files stored those in [lon, lat, time, lev] order we could have dropped degenerate dimensions.

Value

matrix or array


BigelowLab/nam218grads documentation built on Oct. 4, 2022, 2:01 a.m.