CFAxisDiscrete | R Documentation |
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.
ncdfCF::CFObject
-> ncdfCF::CFAxis
-> CFAxisDiscrete
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.
ncdfCF::CFObject$append_attribute()
ncdfCF::CFObject$attribute()
ncdfCF::CFObject$delete_attribute()
ncdfCF::CFObject$dim()
ncdfCF::CFObject$print_attributes()
ncdfCF::CFObject$set_attribute()
ncdfCF::CFObject$update_coordinates_attribute()
ncdfCF::CFObject$write_attributes()
ncdfCF::CFAxis$can_append()
ncdfCF::CFAxis$configure_terms()
ncdfCF::CFAxis$copy_terms()
ncdfCF::CFAxis$copy_with_values()
ncdfCF::CFAxis$detach()
ncdfCF::CFAxis$identical()
ncdfCF::CFAxis$peek()
ncdfCF::CFAxis$shard()
new()
Create a new instance of this class. The values of this axis are always a sequence, but the sequence may start with any positive value such that the length of this instance falls within the length of the axis on file, if there is one.
Creating a new discrete axis is more easily done with the
makeDiscreteAxis()
function.
CFAxisDiscrete$new(var, start = 1L, count)
var
The name of the axis when creating a new axis. When reading an axis from file, the NCVariable object that describes this instance.
start
Optional. Integer value that indicates the starting value of
this axis. Defults to 1L
.
count
Number of elements in the axis.
print()
Summary of the axis printed to the console.
CFAxisDiscrete$print(...)
...
Arguments passed on to other functions. Of particular interest
is width =
to indicate a maximum width of attribute columns.
self
, invisibly.
brief()
Some details of the axis.
CFAxisDiscrete$brief()
A 1-row data.frame
with some details of the axis.
copy()
Create a copy of this axis. The copy is completely separate from this axis, meaning that both this axis and all of its components are made from new instances.
CFAxisDiscrete$copy(name = "")
name
The name for the new axis. If an empty string is passed, will use the name of this axis.
The newly created axis.
indexOf()
Find indices in the axis domain. Given a vector of numerical
values x
, find their indices in the values of the axis. Outside
values will be dropped.
CFAxisDiscrete$indexOf(x, method = "constant", rightmost.closed = TRUE)
x
Vector of numeric values to find axis indices for.
method
Ignored.
rightmost.closed
Ignored.
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
.
slice()
Given a range of coordinate values, returns the indices into the axis that fall within the supplied range. If the axis has auxiliary coordinates selected then these will be used for the identification of the indices to return.
CFAxisDiscrete$slice(rng)
rng
A vector whose extreme values indicate the indices of coordinates to return. The mode of the vector has to be integer or agree with any auxiliary coordinates selected.
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 (boundary) values of the axis fall within
the range of coordinates.
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.
CFAxisDiscrete$subset(name = "", rng = NULL)
name
The name for the new axis. If an empty string is passed, will use the name of this axis.
rng
The range of indices whose values from this axis to include in
the returned axis. If the value of the argument is NULL
, return a
copy of the axis.
A new CFAxisDiscrete
instance covering the indicated range of
indices. If the value of the argument is NULL
, return a copy of
self
as the new axis.
append()
Append a vector of values at the end of the current values of the axis.
CFAxisDiscrete$append(from)
from
An instance of CFAxisDiscrete
whose length to add to this
axis.
A new CFAxisDiscrete
instance with a length that is the sum of
the lengths of this axis and the from
axis.
write()
Write the axis to a netCDF file, including its attributes, but only if it has an associated NC variable in the file.
CFAxisDiscrete$write(nc = NULL)
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 not
NULL
, the handle to a netCDF file or a group therein.
Self, invisibly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.