eventNum | R Documentation |
Computes the event number eventNum
, the length of events
eventLen
, or the sequence number for individual observations within an
event eventSeq
. Added from smwrBase.
eventNum(event, reset = FALSE, na.fix = FALSE)
eventSeq(eventno)
eventLen(eventno, summary = FALSE)
event |
a logical vector where |
reset |
a logical value indicating whether the event is assumed to
continue until the next event, or only while event is |
na.fix |
the value to use where event has missing values ( |
eventno |
an integer vector indicating the event number. Generally the
output from the |
summary |
a logical value, controlling output. See Value for details. |
The function eventNum
returns an integer vector the same
length as event
indicating the event sequence number.
The function eventLen
returns an integer vector the same length as
eventno
indicating the sequence length of the event if summary
is FALSE
, or a named integer vector indicating the sequence length of
each event if summary
is TRUE
.
The function eventSeq
returns an integer vector the same length as
eventno
indicating the sequence number of each element in the
event.
## Notice the difference caused by setting reset to TRUE
eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE))
eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE), reset=TRUE)
## Notice the difference caused by setting reset to TRUE
eventSeq(eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE)))
eventSeq(eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE), reset=TRUE))
## Notice the difference caused by setting reset to TRUE
eventLen(eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE), reset=TRUE))
## This is an example of the summary option
eventLen(eventNum(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE), reset=TRUE), summary=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.