previous_quarter {timeperiodsR}R Documentation

Start and end of previous quarter

Description

Defines first and last date in n previous quarter

Usage

previous_quarter(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:

Value

Object of tpr class

Author(s)

Alexey Seleznev

See Also

For get next other periods see previous_week(), previous_month(), previous_year()

Examples

## To get start, end and sequence of previous quarter
previousquarter <- previous_quarter()

## To get vector of date sequences 
previous_quarter(part = "sequence")
previous_quarter()$sequence
seq(previousquarter)

## Get number of days of previous quarter
day_nums <- previous_quarter(part = "length")
previous_quarter()$length
length(previousquarter)

[Package timeperiodsR version 0.7.3 Index]