Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nc_close

Close a netCDF File


Description

Closes an open netCDF file, which flushes any unwritten data to disk. Always close a netCDF file when you are done with it! You are risking data loss otherwise.

Usage

nc_close( nc )

Arguments

nc

An object of class ncdf4 (as returned by either function nc_open or function nc_create.

Details

Data written to a netCDF file is cached in memory, for better performance. This data is only written out to disk when the file is closed. Therefore, always remember to close a netCDF file when done with it.

Author(s)

David W. Pierce dpierce@ucsd.edu

References

http://dwpierce.com/software

See Also

Examples

## Not run: nc <- nc_open("salinity.nc")
## Not run: data <- ncvar_get( nc )	# Read the "only" var in the file
## Not run: nc_close(nc)

ncdf4

Interface to Unidata netCDF (Version 4 or Earlier) Format Data Files

v1.17
GPL (>= 3)
Authors
David Pierce <dpierce@ucsd.edu>
Initial release
2019-10-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.