View source: R/support_functions.R
get.var.file.idx | R Documentation |
Create mapping from variables to files.
get.var.file.idx(variable.name.map, v.list)
variable.name.map |
A mapping from standardized names (tmax, tmin, prec) to NetCDF variable names. |
v.list |
A list containing a vector of variables in each file. |
Given a variable name map and list of variables in each file, determine a mapping from variables to files.
A vector mapping standardized variable names (tmax, tmin, prec) to indices in the file list.
## Not run: ## Get mapping for a single file. input.files <- c("pr_NAM44_CanRCM4_ERAINT_r1i1p1_1989-2009.nc") f <- lapply(input.files, ncdf4::nc_open) v.list <- lapply(f, ncdf4.helpers::nc.get.variable.list, min.dims=2) v.f.idx <- get.var.file.idx(variable.name.map, v.list) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.