Skip to contents

new_yearquarter() is a constructor for <grates_yearquarter> objects aimed at developers.

Usage

new_yearquarter(x = integer())

is_yearquarter(xx)

Arguments

x

[integer]

Vector representing the number of quarters.

double vectors will be converted via as.integer(floor(x)).

xx

R object.

Value

A <grates_yearquarter> object.

Details

<yearquarter> objects are stored as the number of quarters (starting at 0) since the Unix Epoch (1970-01-01).

Examples

new_yearquarter(1:10)
#> <grates_yearquarter[10]>
#>  [1] "1970-Q2" "1970-Q3" "1970-Q4" "1971-Q1" "1971-Q2" "1971-Q3" "1971-Q4"
#>  [8] "1972-Q1" "1972-Q2" "1972-Q3"