apply_split_indexes_to_stratum: Split a stratum based on a list of indexes

apply_split_indexes_to_stratumR Documentation

Split a stratum based on a list of indexes

Description

Splits stratum 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_stratum(stratum, indexes_1, indexes_2)

Arguments

stratum

(data frame, tibble, list, or vector) stratum to split

indexes_1

(vector) indexes for first split, which can be generated via get_split_indexes_from_stratum

indexes_2

(vector) indexes for second split, which can be generated via get_split_indexes_from_stratum

Value

(list) List with two elements that contain stratum split in two parts.

See Also

Other splitting functions: apply_split_indexes_to_strata(), check_strata(), get_split_indexes_from_strata(), get_split_indexes_from_stratum(), split_df(), split_strata(), split_stratum(), stratify()

Examples

# Random split-half. One of the splits gets 4 elements and the other 5
stratum =  letters[1:9]
indexes = get_split_indexes_from_stratum(stratum)
apply_split_indexes_to_stratum(stratum, indexes[[1]], indexes[[2]])

splithalfr documentation built on Sept. 15, 2023, 1:08 a.m.