The GRtime class handles dates and times for the GENEAread class. The class treats dates as numerics
denoting seconds since the UNIX epoch, with potentially a string attached specifying the format to print in.
Unlike POSIXct
, we avoid some of the processing, especially with respect to time zones, and allow
some more flexibility in time computation and display. A range of operators are defined.
convert.time
converts numerics to GRtime objects. The format
argument allows a format
string to be attached specifying the default format to display in. as.GRtime
is a wrapper to
convert.time
, that when supplied with character input, coerces the value first to numeric using
parse.time
.
format.GRtime
formats GRtime objects for pretty printing. If format
is provided as argument,
that is used. Else, if the format
attribute is set on x
, that is used. Finally, if formats
are not provided, and x
is of length greater than one, the range of values of x
is used to
decide the units displayed. Numerics are also accepted - they are coerced to GRtime.
axis.GRtime
is used to plot GRtime axis, choosing, by default, breakpoints that give 'pretty' sub
intervals. Note that plot.default
uses axis.GRtime
by default if supplied with a
GRtime object in one of the directions. However, image.default
based functions do not use
the class axis functions, so axes must be plotted manually.
pretty.GRtime
computes 'pretty' breakpoints, using the algorithm of pretty.POSIXt
.
Attributes are preserved.
For convert.time
, as.GRtime
and pretty.GRtime
, a GRtime object.
For format.GRtime
a character string representation.
For axis.GRtime
a list containing positions and labels for axis markers.