new_period {grates} | R Documentation |
Minimal constructor for a period object
Description
new_period()
is a constructor for <grates_period>
objects aimed at
developers.
Usage
new_period(x = integer(), n = 1L, offset = 0L)
is_period(xx)
Arguments
x |
Vector representing the number of periods since the Unix Epoch (1970-01-01) and a specified offset.
|
n |
Number of days that are being grouped by. |
offset |
Value you wish to start counting groups from relative to the Unix Epoch. |
xx |
R object. |
Details
grates_period
objects are stored as the integer number, starting at 0L, of
periods since the Unix Epoch (1970-01-01) and a specified offset. Here
periods are taken to mean groupings of n
consecutive days.
For storage and calculation purposes, offset
is scaled relative to n
.
I.e. offset <- offset %% n
and values of x
stored relative to this scaled
offset.
Value
A <grates_period>
object.
Examples
new_period(1:10)