spell_duration: Find spell durations (assuming observations have equal time...

Description Usage Arguments Details Value Examples

Description

Find spell durations (assuming observations have equal time spacing)

Usage

1

Arguments

x

a time ordered vector with values identifying a spell. It is assumed that when a value in this vector changes that the spell has ended.

Details

Note that the function assumes that supplied observations are time ordered and equally spaced in time.

Value

a vector of spell durations for each observation in x.

Examples

1
2
x <- c(rep('a', 4), rep('b', 3), 'c', rep('a', 2), 'c')
spell_duration(x)

christophergandrud/SurvSetup documentation built on May 13, 2019, 7:01 p.m.