View source: R/next_n_months.R
| next_n_months | R Documentation | 
Defines first and last date in next period
next_n_months(x = Sys.Date(), 
              n = 1, 
			        part = getOption("timeperiodsR.parts"), 
	            include_current = F)
x | 
 Date object  | 
n | 
 Number of periods for offset  | 
part | 
 Part of period you need to receive, one of "all", "start", "end","sequence", "length". See details.  | 
include_current | 
 If TRUE incliding current period in sequence  | 
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
Object of tpr class
Alexey Seleznev
For get next other periods see next_n_quarters(), next_n_days(), next_n_years(), next_n_weeks()
## To get start, end and sequence of next 2 months, 
## exclude current month
next2month <- next_n_months(n = 2)
## include current month
next2month_2 <- next_n_months(n = 2, include_current = TRUE)
## To get vector of date sequences 
next_n_months(n = 2, part = "sequence")
next_n_months(n = 2)$sequence
seq(next2month)
## Get number of days of next 2 months
day_nums <- next_n_months(part = "length")
next_n_months()$length
length(next2month)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.