as_deslist | R Documentation |
Create a list of designs from a data frame
as_deslist(data, descol = "ID")
data |
input data set; see Details. |
descol |
character column name to be used for design groups. |
The input data set must have a column with the same name as the value
of descol
. Other column names should be start
(the time
of the first observation), end
(the time of the last observation),
delta
(the time steps to take between start
and end
),
and add
(other, ad-hoc times). Note that add
might be
a list-column
to get a vector of times for each time grid object.
The function returns a list of tgrid
objects,
one for each unique value found in descol
.
idata <- tibble::tibble(ID=1:4, end=seq(24,96,24), delta=6,
add=list(c(122,124,135),c(111), c(99),c(88)))
idata <- dplyr::mutate(idata, GRP = ID %%2)
idata
l <- as_deslist(idata,"GRP")
l
lapply(l,stime)
lapply(as_deslist(idata, "ID"),stime)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.