CFAxisTime | R Documentation |
This class represents a time axis. The functionality is provided
by the CFTime
class in the CFtime
package.
ncdfCF::CFObject
-> ncdfCF::CFAxis
-> CFAxisTime
friendlyClassName
(read-only) A nice description of the class.
time
(read-only) Retrieve the CFTime
instance that manages the
values of this axis.
dimnames
(read-only) The coordinates of the axis as a character vector.
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$detach()
ncdfCF::CFAxis$peek()
ncdfCF::CFAxis$shard()
new()
Create a new instance of this class.
Creating a new time axis is more easily done with the makeTimeAxis()
function.
CFAxisTime$new(var, values, start = 1L, count = NA, attributes = data.frame())
var
The name of the axis when creating a new axis. When reading an axis from file, the NCVariable object that describes this instance.
values
Either the numeric values of this axis, or an instance of
CFTime
or CFClimatology
with bounds set. If these are numeric
values, argument var
must be a NCVariable
.
start
Optional. Integer index where to start reading axis data
from file. The index may be NA
to start reading data from the start.
count
Optional. Number of elements to read from file. This may be
NA
to read to the end of the data.
attributes
Optional. A data.frame
with the attributes of the
axis. When an empty data.frame
(default) and argument var
is an
NCVariable instance, attributes of the axis will be taken from the
netCDF resource.
print()
Summary of the time axis printed to the console.
CFAxisTime$print(...)
...
Arguments passed on to other functions. Of particular interest
is width =
to indicate a maximum width of attribute columns.
brief()
Some details of the axis.
CFAxisTime$brief()
A 1-row data.frame
with some details of the axis.
identical()
Tests if the axis passed to this method is identical to
self
.
CFAxisTime$identical(axis)
axis
The CFAxisTime
instance to test.
TRUE
if the two axes are identical, FALSE
if not.
copy()
Create a copy of this axis. The copy is completely separate
from self
, meaning that both self
and all of its components are made
from new instances.
CFAxisTime$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.
copy_with_values()
Create a copy of this axis but using the supplied values. The attributes are copied to the new axis. Boundary values and auxiliary coordinates are not copied.
After this operation the attributes of the newly created axes may not be accurate, except for the "actual_range" attribute. The calling code should set, modify or delete attributes as appropriate.
CFAxisTime$copy_with_values(name = "", values)
name
The name for the new axis. If an empty string is passed, will use the name of this axis.
values
The values to the used with the copy of this axis. This can
be a CFTime
instance, a vector of numeric values, a vector of
character timestamps in ISO8601 or UDUNITS format, or a vector of
POSIXct
or Date
values. If not a CFTime
instance, the values
will be converted into a CFTime
instance using the definition and
calendar of this axis.
The newly created axis.
append()
Append a vector of time values at the end of the current values of the axis.
CFAxisTime$append(from)
from
An instance of CFAxisTime
whose values to append to the
values of this axis.
A new CFAxisTime
instance with values from this axis and the
from
axis appended.
indexOf()
Retrieve the indices of supplied values on the time axis.
CFAxisTime$indexOf(x, method = "constant", rightmost.closed = FALSE)
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
.
A vector giving the indices in the time axis of valid
values in x
, or NA
if the value is not valid.
slice()
Retrieve the indices of the time axis falling between two extreme values.
CFAxisTime$slice(x, rightmost.closed = FALSE)
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
.
An integer vector giving the indices in the time axis between
values in x
, or integer(0)
if none of the values are valid.
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.
CFAxisTime$subset(name = "", rng = NULL)
name
The name for the new axis. If an empty string is passed (default), 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 CFAxisNumeric
instance covering the indicated range of
indices. If the value of the argument rng
is NULL
, return a copy of
self
as the new axis.
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.
CFAxisTime$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.