as_period: Convert an object to a period

Description Usage Arguments

View source: R/period.R

Description

Convert an object to a period

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
as_period(x, interval, firstdate, ...)

## Default S3 method:
as_period(x, interval, firstdate, ...)

## S3 method for class 'period'
as_period(x, interval = 1L, firstdate = NULL, ...)

## S3 method for class 'Date'
as_period(x, interval = 1L, firstdate = NULL, ...)

## S3 method for class 'POSIXt'
as_period(x, interval = 1L, firstdate = NULL, ...)

## S3 method for class 'character'
as_period(x, interval = 1L, firstdate = NULL, ...)

## S3 method for class 'factor'
as_period(x, interval = 1L, firstdate = NULL, ...)

Arguments

x

'An object to coerce to period.

interval

How many days to include in each period.

firstdate

The date to firstdate the intervals from. If NULL (default) the earliest date in the vector will be used.

...

Not used.


tjtnew/grates documentation built on Feb. 6, 2021, 6:12 p.m.