make_series_id: Creates a unique ID for all uninterrupted series in a vector

Description Usage Arguments Details Value Examples

View source: R/RcppExports.R

Description

Creates a unique ID for all uninterrupted series in a vector

Usage

1
make_series_id(x, delta = 0)

Arguments

x

numeric vector to be used

delta

increment with default delta=0

Details

If x[t] = (x[t-1] + delta) then ID(x[t])=ID(x[t-1]) otherwise ID(x[t]) = ID(x[t-1]) + 1.

Value

an integer vector

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ## Not run: 

 x <- c(0,1,1,1,2,2,1,3,1,0,0)
 y <- c(1998:2000,2005:2010)

 make_series_id(y, delta=1)
 make_series_id(x)

 
## End(Not run) 

sumtxt/datatools documentation built on Oct. 7, 2018, 11:18 p.m.