-
I need to access all previous trials where: key_press = 'a' AND effort_level = 75 Then I need to create an array of their data for a variable called reward_offered (this variable takes integers) So the array of all reward_offered might look like this: array = [12, 14, 6, 9, 12]; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Once you access the data with This is how you filter. Note that var filtered_data = jsPsych.data.get().filter({key_press: 65, effort_level: 75}) Then you can extract var array = filtered_data.select('reward_offered').values; |
Beta Was this translation helpful? Give feedback.
Once you access the data with
jsPsych.data.get()
there are a variety of operations that can be used for filtering, extracting, summarizing, etc.This is how you filter. Note that
key_press: 65
because the key code fora
is65
.Then you can extract
reward_offered
as an array (assuming that it is in the data for that trial):