CFAxisDiscrete {ncdfCF} | R Documentation |
CF discrete axis object
Description
This class represent discrete CF axes, i.e. those axes whose coordinate values do not represent a physical property. The coordinate values are ordinal values equal to the index into the axis.
Super classes
ncdfCF::CFObject
-> ncdfCF::CFAxis
-> CFAxisDiscrete
Active bindings
friendlyClassName
(read-only) A nice description of the class.
dimnames
(read-only) The coordinates of the axis as an integer vector, or labels for every axis element if they have been set.
Methods
Public methods
Inherited methods
ncdfCF::CFObject$add_coordinates()
ncdfCF::CFObject$append_attribute()
ncdfCF::CFObject$attribute()
ncdfCF::CFObject$delete_attribute()
ncdfCF::CFObject$print_attributes()
ncdfCF::CFObject$set_attribute()
ncdfCF::CFObject$write_attributes()
ncdfCF::CFAxis$can_append()
ncdfCF::CFAxis$identical()
ncdfCF::CFAxis$peek()
ncdfCF::CFAxis$shard()
ncdfCF::CFAxis$time()
Method new()
Create a new instance of this class.
Creating a new discrete axis is more easily done with the
makeDiscreteAxis()
function.
Usage
CFAxisDiscrete$new(nc_var, nc_dim, orientation, dim_only = FALSE)
Arguments
nc_var
The netCDF variable that describes this instance.
nc_dim
The netCDF dimension that describes the dimensionality.
orientation
The orientation (
X
,Y
,Z
, orT
) or""
if different or unknown.dim_only
Flag if this axis only has a dimension on file but no NC variable.
Method print()
Summary of the axis printed to the console.
Usage
CFAxisDiscrete$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 brief()
Some details of the axis.
Usage
CFAxisDiscrete$brief()
Returns
A 1-row data.frame
with some details of the axis.
Method append()
Append a vector of values at the end of the current values
of the axis. In a discrete axis the values are always a simple sequence
so the appended values extend the sequence, rather than using the
values from axis from
.
Usage
CFAxisDiscrete$append(from)
Arguments
from
An instance of
CFAxisDiscrete
whose length to add to the length ofself
.
Returns
A new CFAxisDiscrete
with the combined length of self
and the
from
axis.
Method indexOf()
Find indices in the axis domain. Given a vector of numerical
values x
, find their indices in the values of the axis. In effect,
this returns index values into the axis, but outside values will be
dropped.
Usage
CFAxisDiscrete$indexOf(x, method = "constant", rightmost.closed = TRUE)
Arguments
x
Vector of numeric values to find axis indices for.
method
Ignored.
rightmost.closed
Ignored.
Returns
Numeric vector of the same length as x
. Values of x
outside
of the range of the values in the axis are returned as NA
.
Method subset()
Return an axis spanning a smaller coordinate range. This
method returns an axis which spans the range of indices given by the
rng
argument.
Usage
CFAxisDiscrete$subset(group, rng = NULL)
Arguments
group
The group to create the new axis in.
rng
The range of indices from this axis to include in the returned axis.
Returns
A CFAxisDiscrete
instance covering the indicated range of
indices. If the value of the argument is NULL
, return the entire
axis.
Method write()
Write the axis to a netCDF file, including its attributes, but only if it has an associated NC variable in the file.
Usage
CFAxisDiscrete$write(nc = NULL)
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 axis was read from (the file must have been opened for writing). If notNULL
, 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
CFAxisDiscrete$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.