netcdfTOC | R Documentation |
This prints an overview of the variables in a NetCDF file, along with time, longitude and latitude, if the last three are stored as dimensions.
netcdfTOC(file, level = 1L, debug = getOption("oceDebug"))
file |
character value naming a NetCDF file. |
level |
integer indicating the level of the overview. If |
debug |
an integer specifying whether debugging information is
to be printed during the processing. This is a general parameter that
is used by many |
An alternative to this is to examine what is printed by running
ncdf4::nc_open()
with the given filename, but this output can be a bit
confusing to read, especially for files that have voluminous global
attributes.
If level
is 1, then the printed list of variables and dimensions
is returned. Otherwise, more information is printed, but
the return value is the same as for level
1.
Dan Kelley
library(oce)
# Saving to a temporary file for CRAN testing; in practice,
# it's more likely that the user will retain this file, or already
# have a target file on the local system.
if (requireNamespace("ncdf4") &&
requireNamespace("jsonlite") &&
requireNamespace("curl")) {
urlroot <- "ftp://ftp.ifremer.fr/ifremer/argo/dac/bodc/6900388/profiles/"
remotefile <- "D6900388_001.nc"
localfile <- tempfile(fileext = ".nc")
curl::curl_download(paste0(urlroot, remotefile), localfile)
netcdfTOC(localfile)
unlink(localfile)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.