spell_new: Mark new spell as events

Description Usage Arguments Value Examples

Description

Mark new spell as events

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.

Value

a vector of event codes for each observation in x. 0 indicates that there was no spell change. 1 indicates a new spell.

Examples

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

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