R doesn't seem to have a "just load it" function for NetCDF files.
Load all the variables from a NetCDF file into the current session.
library(ncload)
file <- system.file("extdata", "S2008001.L3m_DAY_CHL_chl_ocx_9km.nc", package = "ncload")
nc_load(file)
#> Creating variable objects 'chl_ocx', 'palette'
#> Creating dimension-variable objects 'lat', 'lon'
ls()
#> [1] "chl_ocx" "file" "lat" "lon" "palette"
dim(chl_ocx)
#> [1] 4320 2160
length(lon)
#> [1] 4320
ncload
is currently on Github only, so requires installation with devtools
.
devtools::install_github("mdsumner/ncload")
- check for useability with OpenDAP/Thredds
- selectively load variables, options to avoid/select dimvals
- etc.