get_var | R Documentation |
Data are stored as [lon, lat, time]
or [lon, lat, lev, time]
Degenerate indices (dimension = 1) are discarded, so if a single time is
requested for a [lon, lat, time]
variable then a single band object is
returned.
get_var( x, var = "tmpsfc", bb = get_bounds(x), time = get_loc(x, "time")[1:3], lev = get_loc(x, "lev")[1:5], nav = NULL, shift = 2, form = c("array", "stars")[2] )
x |
ncdf4 object |
var |
character, one or more names of the variables to retrieve |
bb |
a 4 element bounding box for subsetting ordered as
|
time |
POSIXct vector of one or more times to retrieve. These are matched the
closest known times in the object. See |
lev |
numeric vector of one or more levels. These are matched the
closest known levels in the object. See |
nav |
list, see |
shift |
2 number of days to shift the input time - see |
form |
character either 'array' of 'stars' (default)
|
The requested bounding box coordinates are matched to the closest grid cell centers, thus the output grids may differ in extent form the requested bounding box.
Requested times and levels are considered contiguous - we are extracting slabs of data after all. Currently the first and last times or levels requested mark the inclusive bounds of the slab in those dimensions. Requesting a single time or level works pefectly well. If you need disjoint bands (not contiguous bands) then you will need to make a separate request for each.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.