CFLabel | R Documentation |
This class represent CF labels, i.e. a 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.
ncdfCF::CFObject
-> CFLabel
friendlyClassName
(read-only) A nice description of the class.
coordinates
Set or retrieve the labels of this object. Upon retrieval, label values are read from the netCDF resource, if there is one, upon first access and cached thereafter. Upon setting values, if there is a linked netCDF resource, this object will be detached from it.
length
(read-only) The number of labels in the set.
dimid
(read-only) The netCDF dimension id of this label set. This field should only be accessed if the label set is backed by a netCDF resource.
ncdfCF::CFObject$append_attribute()
ncdfCF::CFObject$attribute()
ncdfCF::CFObject$delete_attribute()
ncdfCF::CFObject$detach()
ncdfCF::CFObject$dim()
ncdfCF::CFObject$print_attributes()
ncdfCF::CFObject$set_attribute()
ncdfCF::CFObject$update_coordinates_attribute()
ncdfCF::CFObject$write_attributes()
new()
Create a new instance of this class.
CFLabel$new(var, values = NA, start = NA, count = NA)
var
The NCVariable instance upon which this CF object is based when read from a netCDF resource, or the name for the object new CF object to be created.
values
Optional. The labels of the CF object. Ignored when
argument var
is a NCVariable
object.
start
Optional. Integer index value indicating where to start
reading data from the file. The value may be NA
(default) to read all
data, otherwise it must not be larger than the number of labels.
Ignored when argument var
is not an NCVariable
instance.
count
Optional. Integer value indicating the number of labels to
read from file. The value may be NA
to read to the end of the labels,
otherwise its value must agree with the corresponding start
value and
the number of labels on file. Ignored when argument var
is not an
NCVariable
instance.
A CFLabel
instance.
print()
Prints a summary of the labels to the console.
CFLabel$print(...)
...
Arguments passed on to other functions. Of particular interest
is width =
to indicate a maximum width of attribute columns.
slice()
Given a range of domain coordinate values, returns the indices into the axis that fall within the supplied range.
CFLabel$slice(rng)
rng
A character vector whose extreme (alphabetic) values indicate the indices of coordinates to return.
An integer vector of length 2 with the lower and higher indices
into the axis that fall within the range of coordinates in argument
rng
. Returns NULL
if no values of the axis fall within the range of
coordinates.
subset()
Retrieve a subset of the labels.
CFLabel$subset(name, rng)
name
The name for the new label set, optional.
rng
The range of indices whose values from this axis to include in the returned axis.
A CFLabel
instance, or NULL
if the rng
values are invalid.
write()
Write the labels to a netCDF file, including its attributes.
CFLabel$write(nc, dim)
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.
dim
The dimension to write the labels for. This is the name or dimension id of the object that owns these labels. The dimension must have been written to file before this method is called.
Self, invisibly.
clone()
The objects of this class are cloneable with this method.
CFLabel$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.