Skip to contents

new_int_period() is a constructor for <grates_int_period> objects aimed at developers.

Usage

new_int_period(x = integer(), n = 1L)

is_int_period(xx)

Arguments

x

[integer]

Vector representing the number of n-integers from 0.

double vectors will be converted via as.integer(floor(x)).

n

[integer]

Number of integers that are being grouped. Must be greater than 0.

xx

R object.

Value

A <grates_int_period> object.

Details

grates_int_period objects are stored as the integer number of n-integer groups from 0. Here n-integer is taken to mean a 'grouping of n consecutive integers'.

Examples

new_int_period(1:10, 2L)
#> <grates_int_period[10]>
#>  [1] [2, 3]   [4, 5]   [6, 7]   [8, 9]   [10, 11] [12, 13] [14, 15] [16, 17]
#>  [9] [18, 19] [20, 21]