set_parameters: Modify a timeline to set parameter values

Description Usage Arguments Details Value See Also Examples

View source: R/timeline_modify.R

Description

Modify a timeline to set parameter values

Usage

1
set_parameters(timeline, ...)

Arguments

timeline

The timeline object

...

A set of name/value pairs defining the parameters

Details

The set_parameters() function provides a general purpose method of adding arbitrary parameters to an existing timeline. Anything that jsPsych recognises as a possible timeline parameter can be inserted using this method. Some possibilities are shown in the examples section.

Value

The modified timeline object

See Also

build_timeline, set_variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# typically we begin with a trial template:
trial_template <- trial_html_button_response(
     stimulus = insert_variable(name = "my_stimulus"),
     choices = c("true", "false")
 )

 # then we fill it out so that there is now a "block" of trials:
 equations <- c("13 + 23 = 36",  "17 - 9 = 6", "125 / 5 = 25")
 trials <- build_timeline(trial_template) %>%
     set_variables(my_stimulus = equations)

 # we can randomise presentation order and repeat the block:
 trials <- trials %>%
     set_parameters(randomize_order = TRUE, repetitions = 2)

djnavarro/jaysire documentation built on April 12, 2021, 4:25 a.m.