timeSpan {splusTimeDate} | R Documentation |
Constructor Function For timeSpan
Class
Description
Constructs an object of class timeSpan
.
Usage
timeSpan(charvec, in.format, format, julian, ms)
Arguments
charvec |
the character vector to parse. |
in.format |
the time span input format for parsing. Defaults to
|
format |
the output format to apply to the returned object. Defaults to
|
julian |
the integer vector of days of the time span. Can be a non-integer
if |
ms |
an integer vector of milliseconds of the time span. |
Details
You can call this function with no arguments. If you supply any arguments,
at least one of charvec
, julian
, or ms
must be present.
If
charvec
is given, thein.format
is used to parsecharvec
into time spans, and thejulian
andms
arguments are ignored (with a warning to the user if they are present).If
format
is given, it is put into theformat
slot of the output.If
julian
and/orms
are provided instead ofcharvec
, these values are put into thetimeSpan
as the number of days and milliseconds, respectively, of the time span.
Value
returns a timeSpan
object constructed from the input. If you provide
no arguments, returns the default (empty) timeSpan
object.
See Also
timeSpan
class, format.timeSpan
.
Examples
timeSpan()
timeSpan(c( "378d 21h 04min 36s 365MS", "378 d", "1y, 13d, 21h 4MS"))
timeSpan(julian=c(398, 399, 400), ms=c(298392, 3, 0))