Defines first and last date in n next quarter
next_quarter(x = Sys.Date(),
n = 1,
part = c("all", "start",
"end","sequence", "length"))
Date object
Number of periods for offset
Part of period you need to receive, one of "all", "start", "end","sequence", "length". See details.
Object of tpr class
You can get object of tpr class with all components or specify which component you need, use part
for manage this option:
all - get all components
start - get only first date of period
end - get only last date of period
start - get vector of all dates in period
length - get number of dates in period
For get next other periods see next_week()
, next_month()
, next_year()
# NOT RUN {
## To get start, end and sequence of next quarter
nextquarter <- next_quarter()
## To get vector of date sequences
next_quarter(part = "sequence")
next_quarter()$sequence
seq(nextquarter)
## Get number of days of next quarter
day_nums <- next_quarter(part = "length")
next_quarter()$length
length(nextquarter)
# }
Run the code above in your browser using DataLab