Skip to contents

An event sequence can be replicated a certain number of times in a certain number of IDs.

Usage

ev_rep(x, ID = 1, n = NULL, wait = 0, as.ev = FALSE, id = NULL)

Arguments

x

event object

ID

numeric vector if IDs

n

passed to ev_repeat

wait

passed to ev_repeat

as.ev

if TRUE an event object is returned

id

deprecated; use ID instead

Value

A single data.frame or event object as determined by the value of as.ev.

See also

Examples


e1 <- c(ev(amt=100), ev(amt=200, ii=24, addl=2, time=72))

ev_rep(e1, 1:5)
#>     ID time amt cmt evid ii addl
#> 1    1    0 100   1    1  0    0
#> 2    1   72 200   1    1 24    2
#> 1.1  2    0 100   1    1  0    0
#> 2.1  2   72 200   1    1 24    2
#> 1.2  3    0 100   1    1  0    0
#> 2.2  3   72 200   1    1 24    2
#> 1.3  4    0 100   1    1  0    0
#> 2.3  4   72 200   1    1 24    2
#> 1.4  5    0 100   1    1  0    0
#> 2.4  5   72 200   1    1 24    2