View source: R/support_functions.R
get.northern.hemisphere.booleans | R Documentation |
Determine what portions of a subset are within the northern hemisphere.
get.northern.hemisphere.booleans(subset, f, v, projection)
subset |
The subset to use. |
f |
The NetCDF file to use; an object of class |
v |
The variable in question. |
projection |
The proj4 string to use; NULL if the data is not in a projected coordinate space. |
Given a subset, a file, a variable, and a projection, determine what positions are within the northern hemisphere, returning the result as an array of booleans.
An array of booleans corresponding to the subset containing TRUE if the point is within the northern hemisphere, and FALSE otherwise.
## Open files, etc. input.files <- c("tasmax_NAM44_CanRCM4_ERAINT_r1i1p1_1989-2009.nc") f <- list(nc_open(input.files)) f.v <- lapply(f, ncdf4.helpers::nc.get.variable.list, min.dims=2) bools <- get.northern.hemisphere.booleans(list(X=1:2, Y=1:2), f[[1]], f.v[[1]], NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.