Hello,
I would like to run a local experiment and have the data plotted at the very end (Reaction Times).
I would like to work on a vector with all the Reaction Times computed from my KeyPress component, however, when I call it at the end of the experiment (right before closing everything), only the latest reaction time appears.
Is there a way to have the entire vector of reaction times from all the trials?
Thanks
Mauro
There is some way to extract a vector of a particular variable from the data structure but I can’t recall it at the moment. What you could do as an alternative is to manually add reaction times to a list on each trial.
e.g. insert a code component (from the “custom” component panel"). In the “begin experiment” tab, put something like this to initialise an empty list:
reaction_time_list = []
Then in the “end routine” tab, put something like this to store a value on each trial:
reaction_time_list.append(your_keyboard_component_name.rt)
If needed, you could use a numpy
array instead of a list.