| split_imputations | R Documentation |
imputation_single() into multiple imputation_df()'s by IDSplit a flat list of imputation_single() into multiple imputation_df()'s by ID
split_imputations(list_of_singles, split_ids)
list_of_singles |
A list of |
split_ids |
A list with 1 element per required split. Each element
must contain a vector of "ID"'s which correspond to the |
This function converts a list of imputations from being structured per patient to being structured per sample i.e. it converts
obj <- list(
imputation_single("Ben", numeric(0)),
imputation_single("Ben", numeric(0)),
imputation_single("Ben", numeric(0)),
imputation_single("Harry", c(1, 2)),
imputation_single("Phil", c(3, 4)),
imputation_single("Phil", c(5, 6)),
imputation_single("Tom", c(7, 8, 9))
)
index <- list(
c("Ben", "Harry", "Phil", "Tom"),
c("Ben", "Ben", "Phil")
)
Into:
output <- list(
imputation_df(
imputation_single(id = "Ben", values = numeric(0)),
imputation_single(id = "Harry", values = c(1, 2)),
imputation_single(id = "Phil", values = c(3, 4)),
imputation_single(id = "Tom", values = c(7, 8, 9))
),
imputation_df(
imputation_single(id = "Ben", values = numeric(0)),
imputation_single(id = "Ben", values = numeric(0)),
imputation_single(id = "Phil", values = c(5, 6))
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.