control_for | R Documentation |
Specifies variables that should be controlled for in the generated stimuli, after splitting. Can be run multiple times to control for multiple variables.
control_for(x, var, tol = NA, standard_eval = FALSE)
x |
A data frame containing the IV and strings, or a LexOPS_pipeline object resulting from one of |
var |
The column to treat as a control (non-standard evaluation). |
tol |
The tolerance of the control. For numeric variables, this should be in the form lower:upper (e.g. |
standard_eval |
Logical; bypasses non-standard evaluation, and allows more standard R objects in |
Returns df
, with details on the variables to be controlled for added to the attributes. Run the generate()
function to then generate the actual stimuli.
# Create 3 levels of syllables, for 1-3, 4-6, and 7-20 syllables, and control for word frequency
lexops |>
split_by(Syllables.CMU, 1:3 ~ 4:6 ~ 7:20) |>
control_for(Zipf.SUBTLEX_UK, -0.2:0.2)
# Control for multiple variables
lexops |>
split_by(Syllables.CMU, 1:3 ~ 4:6 ~ 7:20) |>
control_for(Zipf.SUBTLEX_UK, -0.2:0.2) |>
control_for(PoS.SUBTLEX_UK)
# Bypass non-standard evaluation
lexops |>
split_by("Syllables.CMU", list(c(1, 3), c(4, 6), c(7, 20)), standard_eval = TRUE) |>
control_for("Zipf.SUBTLEX_UK", c(-0.2, 0.2), standard_eval = TRUE) |>
control_for("PoS.SUBTLEX_UK", standard_eval = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.