| apply_split_indexes_to_strata {splithalfr} | R Documentation |
Split each element of a list of strata based on a list of indexes
Description
Splits each element of strata into two parts based on a list of
indexes. For more information about splitting options, and an extensive list
of examples, see get_split_indexes_from_stratum.
Usage
apply_split_indexes_to_strata(strata, indexes)
Arguments
strata |
(list) list of strata to split |
indexes |
(list) list of indexes, which can be generated via
|
Value
(list) A list with two elements, containing the first and second
split of strata.
See Also
Other splitting functions:
apply_split_indexes_to_stratum(),
check_strata(),
get_split_indexes_from_strata(),
get_split_indexes_from_stratum(),
split_df(),
split_strata(),
split_stratum(),
stratify()
Examples
# Stratify a data frame, then split it odd-even
ds <- data.frame(condition = rep(c("a", "b"), each = 4), score = 1 : 8)
strata <- stratify(ds, ds$condition)
split_indexes <- get_split_indexes_from_strata(strata, method = "odd_even")
apply_split_indexes_to_strata(strata, split_indexes)
[Package splithalfr version 2.2.2 Index]