Learn R Programming

hyfo (version 1.3.4)

getNcdfVar: Get variable name of the NetCDF file.

Description

Get variable name in the NetCDF file. After knowning the name, you can use loadNcdf to load the target variable.

Usage

getNcdfVar(filePath)

Arguments

filePath
A path pointing to the netCDF file.

Value

  • The names of the varialbes in the file.

References

  • David Pierce (2014). ncdf: Interface to Unidata netCDF data files. R package version 1.6.8. http://CRAN.R-project.org/package=ncdf

Examples

Run this code
# First open the test NETcDF file.
filePath <- system.file("extdata", "tnc.nc", package = "hyfo")

# Then if you don't know the variable name, you can use \\code{getNcdfVar} to get variable name
varname <- getNcdfVar(filePath)

# More examples can be found in the user manual on http://yuanchao-xu.github.io/hyfo/

Run the code above in your browser using DataLab