NCResource: NetCDF resource object

NCResourceR Documentation

NetCDF resource object

Description

This class contains the connection details to a netCDF resource.

There is a single instance of this class for every netCDF resource, owned by the CFDataset instance. The instance is shared by other objects, specifically NCGroup instances, for access to the underlying resource for reading of data.

This class should never have to be accessed directly. All access is handled by higher-level methods.

Public fields

error

Error message, or empty string.

Active bindings

friendlyClassName

(read-only) A nice description of the class.

handle

(read-only) The handle to the netCDF resource.

uri

(read-only) The URI of the netCDF resource, either a local filename or the location of an online resource.

can_write

(read-only) Is the resource writable?

Methods

Public methods


Method new()

Create a connection to a netCDF resource. This is called by open_ncdf() when opening a netCDF resource or when saving a dataset to file. You should never have to call this directly.

Usage
NCResource$new(uri, write)
Arguments
uri

The URI to the netCDF resource.

write

Logical flag to indicate if the resource should be read-write.

Returns

An instance of this class.


Method print()

Print a summary of the netCDF resource to the console.

Usage
NCResource$print()
Returns

Self, invisibly.


Method create()

Create a new file on disk for the netCDF resource.

Usage
NCResource$create()
Returns

Self, invisibly.


Method close()

Closing an open netCDF resource. It should rarely be necessary to call this method directly.

Usage
NCResource$close()

Method sync()

Write any buffered data to the netCDF resource.

Usage
NCResource$sync()

Method group_handle()

Every group in a netCDF file has its own handle, with the "root" group having the handle for the entire netCDF resource. The handle returned by this method is valid only for the named group.

Usage
NCResource$group_handle(group_name)
Arguments
group_name

The absolute path to the group.

Returns

The handle to the group.


Method clone()

The objects of this class are cloneable with this method.

Usage
NCResource$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


ncdfCF documentation built on Jan. 24, 2026, 1:08 a.m.