Description Usage Arguments Value Examples
Computes the event number eventNum
, the length of events
eventLen
, or the sequence number for individual observations within an
event eventSeq
.
1 2 3 4 5 |
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.
1 2 3 4 5 6 7 8 9 10 11 12 | ## 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.