ev_assign | R Documentation |
Replicate a list of events into a data set
ev_assign(l, idata, evgroup, join = FALSE)
assign_ev(...)
l |
list of event objects. |
idata |
an idata set (one ID per row). |
evgroup |
the character name of the column in |
join |
if |
... |
used to pass arguments from |
ev_assign()
connects events in a list passed in as the l
argument to
values in the data set identified in the evgroup
argument. For making
assignments, the unique values in the evgroup
column are first sorted so
that the first sorted unique value in evgroup
is assigned to the first
event in l
, the second sorted value in evgroup
column is assigned to the
second event in l
, and so on. This is a change from previous behavior,
which did not sort the unique values in evgroup
prior to making the
assignments.
ev1 <- ev(amt = 100)
ev2 <- ev(amt = 300, rate = 100, ii = 12, addl = 10)
idata <- data.frame(ID = seq(10))
idata$arm <- 1+(idata$ID %%2)
ev_assign(list(ev1, ev2), idata, "arm", join = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.