| prep_groups | R Documentation |
Normalize and validate a grouping specification for use with group_imp().
prep_groups(
obj_cn,
group,
subset = NULL,
min_group_size = 0,
allow_unmapped = FALSE,
seed = NULL
)
obj_cn |
Character vector of column names from the data matrix, usually
|
group |
Specification of how features should be grouped for imputation. Accepted formats are:
|
subset |
Optional character vector of feature names to impute. If
|
min_group_size |
Integer or |
allow_unmapped |
Logical. If |
seed |
Integer, numeric, or |
prep_groups() converts long-format or list-column group specifications
into a validated slideimp_tbl, enforces feature and auxiliary-column set
relationships, prunes dropped columns, and optionally pads small groups.
Let A be obj_cn and B be the union of all feature and
auxiliary names in group. When allow_unmapped = FALSE, the function
enforces A \subseteq B: every matrix column must appear somewhere in
the grouping specification.
Elements in B but not in A, such as previously dropped probes,
are pruned from each group. Groups left with zero features after pruning
are removed with a diagnostic message.
A data frame of class slideimp_tbl containing:
group: original group labels, if provided, or sequential group labels.
feature: a list-column of character vectors containing feature names.
aux: a list-column of character vectors containing auxiliary names.
parameters: a list-column of per-group configuration lists.
group_imp()
sim <- sim_mat(n = 10, p = 20)
prepped <- prep_groups(colnames(sim$input), sim$col_group)
prepped
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.