open.nc: Open a NetCDF Dataset

Description Usage Arguments Details Value Author(s) References Examples

View source: R/RNetCDF.R

Description

Open an existing NetCDF dataset for reading and (optionally) writing.

Usage

1
   open.nc(con, write=FALSE, share=FALSE, prefill=TRUE, ...)

Arguments

con

Filename of the NetCDF dataset to be opened. If the underlying NetCDF library supports OPeNDAP, con may be an OPeNDAP URL.

write

If FALSE (default), the dataset will be opened read-only. If TRUE, the dataset will be opened read-write.

share

The buffer scheme. If FALSE (default), dataset access is buffered and cached for performance. However, if one or more processes may be reading while another process is writing the dataset, set to TRUE.

prefill

The prefill mode. If TRUE (default), newly defined variables are initialised with fill values when they are first accessed. This allows unwritten array elements to be detected when reading, but it also implies duplicate writes if all elements are subsequently written with user-specified data. Enhanced write performance can be obtained by setting prefill=FALSE.

...

Arguments passed to or from other methods (not used).

Details

This function opens an existing NetCDF dataset for access. By default, the dataset is opened read-only. If write=TRUE, then the dataset can be changed. This includes appending or changing data, adding dimensions, variables, and attributes.

Value

Object of class "NetCDF" which points to the NetCDF dataset.

Author(s)

Pavel Michna, Milton Woods

References

http://www.unidata.ucar.edu/software/netcdf/

Examples

1
2
3
4
5
6
7
##  Create a void NetCDF dataset
nc <- create.nc("open.nc")
close.nc(nc)

##  Open the NetCDF dataset for writing
nc <- open.nc("open.nc", write=TRUE)
close.nc(nc)

Example output



RNetCDF documentation built on May 2, 2019, 6:12 p.m.