Helper functions to treat a NetCDF variable as an R array

nchelper(file, varname = NULL)

Arguments

file

NetCDF file

varname

NetCDF variable to access

Value

nchelper object

Details

Create an object to represent a NetCDF variable, primarily to access slices from it with R's Extract syntax for arrays.

Examples

f <- system.file("extdata", "avhrr-only-v2.20180126.nc", package = "nchelper") a <- nchelper(f, "sst") plot(a[,360,,] * 0.01, ylim = c(20, 32), type = "l")