Last chance! 50% off unlimited learning
Sale ends in
Create tpr object between start and end dates
custom_period( start,
end,
part = getOption("timeperiodsR.parts"))
Object of tpr class
Start date in YYYY-MM-DD format
End date in YYYY-MM-DD format
Part of period you need to receive, one of "all", "start", "end","sequence", "length", "workdays", "weekends", "first_workday", "last_workday", "first_weekend", "last_weekend", "length". See details.
Alexey Seleznev
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
## To create tpr object between two dates
customper <- custom_period(start = "2019-09-01",
end = "2019-09-05")
## To get vector of date sequences
seq(customper)
## Get number of days of previous months
length(customper)
## To get start of end dates
start(customper)
end(customper)
Run the code above in your browser using DataLab