next_month: Start and end of next month

View source: R/next_month.R

next_monthR Documentation

Start and end of next month

Description

Defines first and last date in next month and all dates in month

Usage

next_month(x = Sys.Date(),
           n = 1, 
           part = getOption("timeperiodsR.parts"))

Arguments

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.

Details

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

Value

Object of tpr class

Author(s)

Alexey Seleznev

See Also

For get next other periods see next_week(), next_quarter(), next_year()

Examples

## To get start, end and sequence of next month
nextmonth <- next_month()

## To get vector of date sequences 
next_month(part = "sequence")
next_month()$sequence
seq(nextmonth)

## Get number of days of next months
day_nums <- next_month(part = "length")
next_month()$length
length(nextmonth)

selesnow/timeperiodsR documentation built on Jan. 27, 2024, 7:32 a.m.