CFLabel: CF label object

CFLabelR Documentation

CF label object

Description

This class represent CF labels, i.e. an NC variable of character type that provides a textual label for a discrete or general numeric axis. See also CFAxisCharacter, which is an axis with character labels.

Super class

ncdfCF::CFObject -> CFLabel

Public fields

NCdim

The NCDimension that stores the netCDF dimension details.

Active bindings

friendlyClassName

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

coordinates

(read-only) The label set as a vector.

length

(read-only) The number of labels in the set.

dimid

(read-only) The netCDF dimension id of this label set.

Methods

Public methods

Inherited methods

Method new()

Create a new instance of this class.

Usage
CFLabel$new(grp, nc_var, nc_dim, values)
Arguments
grp

The group that contains the netCDF variable.

nc_var

The netCDF variable that describes this instance.

nc_dim

The netCDF dimension that describes the dimensionality.

values

Character vector of the label values.


Method print()

Prints a summary of the labels to the console.

Usage
CFLabel$print(...)
Arguments
...

Arguments passed on to other functions. Of particular interest is ⁠width = ⁠ to indicate a maximum width of attribute columns.

Returns

self, invisibly.


Method subset()

Retrieve a subset of the labels.

Usage
CFLabel$subset(grp, rng)
Arguments
grp

The group to create the new label object in.

rng

The range of indices to retrieve.

Returns

A CFLabel instance, or NULL if the rng values are invalid.


Method write()

Write the labels to a netCDF file, including its attributes.

Usage
CFLabel$write(nc)
Arguments
nc

The handle of the netCDF file opened for writing or a group in the netCDF file. If NULL, write to the file or group where the labels were read from (the file must have been opened for writing). If not NULL, the handle to a netCDF file or a group therein.

Returns

Self, invisibly.


Method clone()

The objects of this class are cloneable with this method.

Usage
CFLabel$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


ncdfCF documentation built on April 16, 2025, 9:08 a.m.