CFAxisTime {ncdfCF} | R Documentation |
Time axis object
Description
This class represents a time axis. The functionality is provided
by the CFTime
class in the CFtime
package.
Super classes
ncdfCF::CFObject
-> ncdfCF::CFAxis
-> CFAxisTime
Active bindings
friendlyClassName
(read-only) A nice description of the class.
dimnames
(read-only) The coordinates of the axis as a character vector.
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$peek()
ncdfCF::CFAxis$shard()
Method new()
Create a new instance of this class.
Creating a new time axis is more easily done with the makeTimeAxis()
function.
Usage
CFAxisTime$new(nc_var, nc_dim, values)
Arguments
nc_var
The netCDF variable that describes this instance.
nc_dim
The netCDF dimension that describes the dimensionality.
values
The
CFTime
instance that manages this axis.
Method print()
Summary of the time axis printed to the console.
Usage
CFAxisTime$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
CFAxisTime$brief()
Returns
A 1-row data.frame
with some details of the axis.
Method time()
Retrieve the CFTime
instance that manages the values of
this axis.
Usage
CFAxisTime$time()
Returns
An instance of CFTime
.
Method identical()
Tests if the axis passed to this method is identical to
self
.
Usage
CFAxisTime$identical(axis)
Arguments
axis
The
CFAxisTime
instance to test.
Returns
TRUE
if the two axes are identical, FALSE
if not.
Method append()
Append a vector of time values at the end of the current values of the axis.
Usage
CFAxisTime$append(from)
Arguments
from
An instance of
CFAxisTime
whose values to append to the values ofself
.
Returns
A new CFAxisTime
instance with values from self and the from
axis appended.
Method indexOf()
Retrieve the indices of supplied values on the time axis.
Usage
CFAxisTime$indexOf(x, method = "constant", rightmost.closed = FALSE)
Arguments
x
A vector of timestamps whose indices into the time axis to extract.
method
Extract index values without ("constant", the default) or with ("linear") fractional parts.
rightmost.closed
Whether or not to include the upper limit. Default is
FALSE
.
Returns
An integer vector giving the indices in the time axis of valid
values in x
, or NA
if the value is not valid.
Method slice()
Retrieve the indices of the time axis falling between two extreme values.
Usage
CFAxisTime$slice(x, rightmost.closed = FALSE)
Arguments
x
A vector of two timestamps in between of which all indices into the time axis to extract.
rightmost.closed
Whether or not to include the upper limit. Default is
FALSE
.
Returns
An integer vector giving the indices in the time axis between
values in x
, or integer(0)
if none of the values are valid.
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
CFAxisTime$subset(group, rng = NULL)
Arguments
group
The group to create the new axis in.
rng
The range of indices whose values from this axis to include in the returned axis.
Returns
A CFAxisTime
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. If the calendar name is "gregorian", it will be set to the functionally identical calendar "standard" as the former is deprecated.
Usage
CFAxisTime$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
CFAxisTime$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.