Skip to Content

NetCDF

ncdf4

This package provides a high-level R interface to data files written using Unidata's netCDF library (version 4 or earlier), which are binary data files that are portable across platforms and include metadata information in addition to the data sets. Using this package, netCDF files (either version 4 or "classic" version 3) can be opened and data sets read in easily. It is also easy to create new netCDF dimensions, variables, and files, in either version 3 or 4 format, and manipulate existing netCDF files. This package replaces the former ncdf package, which only worked with netcdf version 3 files. For various reasons the names of the functions have had to be changed from the names in the ncdf package. The old ncdf package is still available at the URL given below, if you need to have backward compatibility. It should be possible to have both the ncdf and ncdf4 packages installed simultaneously without a problem. However, the ncdf package does not provide an interface for netcdf version 4 files.

ncvar

This package provides a high-level R interface to Unidata's NetCDF data files. Using this package netCDF datasets, and all their associated metadata, can be read and written in one go. It is also easy to create datasets including lots of metadata. This package supports both the CF and default NetCDF metadata conventions. This package supports more general NetCDF files and conventions than the ncdf package by David Pierce. It requires the low-level NetCDF package RNetCDF by Pavel Michna.

ncdf

This package provides a high-level R interface to Unidata's netCDF data files, which are portable across platforms and include metadata information in addition to the data sets. Using this package netCDF files can be opened and data sets read in easily. It is also easy to create new netCDF dimensions, variables, and files, or manipulate existing netCDF files. This interface provides considerably more functionality than the old "netCDF" package for R, and is not compatible with the old "netCDF" package for R. Release 1.2 (2005-01-24) adds better support for character variables, and miscellaneous bug fixes. Release 1.3 (2005-03-27) is for miscellaneous bug fixes, and improves the documentation. Release 1.4 (2005-06-27) improves the efficiency, and adds small bug fixes. Release 1.5 (2006-02-27) adds support for byte variables, plus small bug fixes. Release 1.6 (2006-06-19) adds various bug fixes, plus support for making dimensions WITHOUT dimvars (coordinate variables), although I think this is a bad idea in general. ALSO, the default behavior for put.var.ncdf with unlimited variables and NO specified start and count parameters has changed! Before, the default was to append to the end of the existing variable. Now, the default is to assume a start of 1 along each dimension, and a count of the current length of each dimension. This really can be ambiguous when using an unlimited dimension. I always specify both start and count when writing to a variable with an unlimited dimension, and suggest you do as well. I may require this in a future release, as it seems to cause people problems.