read_nc | R Documentation |
This function read the netCDF (.nc) file associated with the varname argument, extract the data and slice it according to specified arguments. The function return a list containing the sliced data, its coordinates and others useful metadata.
read_nc( varname, longitude = NA, latitude = NA, time = NA, path_to_data = NA, date_format = "%Y-%m" )
varname |
Name of the variable |
longitude |
Default = NA, Range of longitude to slice the variable data. If NA, the whole dimensions is imported. The longitude argument must be NA or a vector of length 2. |
latitude |
Default = NA, Range of latitude to slice the variable data. If NA, the whole dimension is imported. The latitude argument must be NA or a vector of length 2. |
time |
Default = NA, Range of time to slice the variable data. If NA, the whole dimension is imported. The time argument must be NA or a vector of length 2. |
path_to_data |
Default = NA. The path to the data directory. If NA, the path is store in /extdata/pkg_params.rdata under the name data_path |
date_format |
Default = "
Default can be seen as "YYYY-MM".
Other possible format are available via |
Return a list containing the sliced data, its dimensions and their values and the variable units.
To get all the possible field names, use the command names
.
Example : names(var_data)
## Not run: var = read_nc("bottom_temperature") var = read_nc("bottom_temperature", longitude=c(-64,-50), latitude=c(34,50), time = c("1985-01","2004-11")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.