| split_random | R Documentation |
Adds a split to the data comparable to that made by split_by, but split randomly through the data. All entries in df of the resulting LexOPS_pipeline object are assigned a level randomly.
split_random(x, nlevels = 2, seed = NA, equal_size = FALSE)
x |
A data frame containing the IV and strings, or a LexOPS_pipeline object resulting from one of |
nlevels |
An integer, specifying how many levels this random split should have (default = 2). |
seed |
Deprecated: set seeds externally instead (e.g., |
equal_size |
Logical; should LexOPS create equal (or as close to equal as possible) numbers of candidates for each level? When |
A LexOPS_pipeline object, where df has a new column (name defined by cond_col argument) identifying which level of the randomly generated IV each item belongs to.
library(lexopsdata)
# 2 (syllables: few, many) by 2 (random: level 1, level 2) design
lexops |>
split_by(Syllables.CMU, 1:3 ~ 4:6) |>
split_random(nlevels = 2, equal_size = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.