Set a Period and Get its Time Interval
Set a Period and Get its Time Interval
.interval
Stores a time interval.
fuzzy
Either `-1` (approximate) or `1` (uncertain).
express
Either `-1` (before) or `1` (after).
.interval
Stores a time interval.
interval
Convert and return a POSIXt time interval.
time_span
Convert and return a time span in years.
iso_format
Convert and return a date in ISO 8601.
new()
Helper function to specify a time period.
Create a time period.
Periods$new(...)
...
Intervals, numerical scalars, or objects of
class Period
.
x
A numerical scalar. The range of valid values
depends on type
. If type
is "early"
,
"mid"
, or "late"
, x
is ignored.
type
A character scalar. The following values
are supported: "early"
, "mid"
, "late"
,
"quarter"
, "third"
, and "half"
. If
type
is `NULL`, x
defines a year or decade.
set_additions()
Set additions for a time period.
Periods$set_additions(x)
x
A character vector.
take()
Specify a period.
Periods$take(x = NA, type = NA, ignore_errors = FALSE)
x
A numerical scalar. The range of valid values
depends on type
. If type
is "early"
,
"mid"
, or "late"
, x
is ignored.
type
A character scalar. The following values
are supported: "early"
, "mid"
, "late"
,
"quarter"
, "third"
, and "half"
. If
type
is `NULL`, x
defines a year or decade.
ignore_errors
If `TRUE`, error messages are ignored.
Object of R6Class
with methods to set
common time periods and specifications for time periods.
clone()
The objects of this class are cloneable with this method.
Periods$clone(deep = FALSE)
deep
Whether to make a deep clone.
An Object of R6Class
with methods to set
common time periods and specifications for time periods.