year_quarter_day {clock} | R Documentation |
Calendar: year-quarter-day
Description
year_quarter_day()
constructs a calendar from the fiscal year, fiscal
quarter, and day of the quarter, along with a value determining which
month the fiscal year start
s in.
Usage
year_quarter_day(
year,
quarter = NULL,
day = NULL,
hour = NULL,
minute = NULL,
second = NULL,
subsecond = NULL,
...,
start = NULL,
subsecond_precision = NULL
)
Arguments
year |
The fiscal year. Values |
quarter |
The fiscal quarter. Values |
day |
The day of the quarter. Values If |
hour |
The hour. Values |
minute |
The minute. Values |
second |
The second. Values |
subsecond |
The subsecond. If specified, If using milliseconds, values If using microseconds, values If using nanoseconds, values |
... |
These dots are for future extensions and must be empty. |
start |
The month to start the fiscal year in. 1 = January and 12 = December. If |
subsecond_precision |
The precision to interpret |
Details
Fields are recycled against each other using tidyverse recycling rules.
Fields are collected in order until the first NULL
field is located. No
fields after the first NULL
field are used.
Value
A year-quarter-day calendar vector.
Examples
# Year-quarter type
x <- year_quarter_day(2019, 1:4)
x
add_quarters(x, 2)
# Set the day to the last day of the quarter
x <- set_day(x, "last")
x
# Start the fiscal year in June
june <- 6L
y <- year_quarter_day(2019, 1:4, "last", start = june)
# Compare the year-month-day values that result from having different
# fiscal year start months
as_year_month_day(x)
as_year_month_day(y)