set_options | R Documentation |
When the first function called in a generate pipeline, allows the user to set options that will be passed to all subsequent functions in the pipeline.
set_options(df, id_col = "string", cond_col = "LexOPS_splitCond")
df |
The dataframe that will be used in the generate pipeline. |
id_col |
A character vector specifying the column identifying unique observations (e.g. in |
cond_col |
Prefix with which to name the columns where conditions will be stored (default = "LexOPS_splitCond"). Each time |
Returns df
, with the options stored in the attributes.
# give a df with "word" as the identifying column
lexops |>
dplyr::rename(word = string) |>
# tell LexOPS "word" is the identifying column
set_options(id_col = "word") |>
split_by(Syllables.CMU, 1:3 ~ 4:6 ~ 7:20) |>
control_for(Zipf.SUBTLEX_UK, -0.2:0.2) |>
generate(n = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.