Skip to contents

By default, the code expects a file with a single JSON structure with white spaces and line delimiters (single = T). The alternative behaviour (single = F) expects a format with multiple JSON records, each in a single line. Results stored in JATOS server follow this structure.

Usage

read_jspsych(filepath, single = T)

Arguments

filepath

File to read

single

Indicates whether the file contains a single record or multiple records (each on separate line)

Value

A tibble with each trial/plugin result as a separate line. The tibble features following columns:

  • trial_type (string) - The name of the plugin used to run the trial.

  • trial_index (numeric) - The index of the current trial across the whole experiment.

  • time_elapsed (numeric) - The number of milliseconds between the start of the experiment and when the trial ended.

  • internal_node_id (string) - A string identifier for the current TimelineNode.

  • raw (list) - list column with all plugin data

Examples

read_jspsych(demo_file("jspsych-html-button-response.json"))
#> # A tibble: 3 × 6
#>   record trial_type           trial_index time_elapsed internal_n…¹ raw         
#>    <dbl> <chr>                      <int>        <int> <chr>        <list>      
#> 1      1 html-button-response           0         7419 0.0-0.0      <named list>
#> 2      1 html-button-response           1        11133 0.0-1.0      <named list>
#> 3      1 html-button-response           2        13140 0.0-2.0      <named list>
#> # … with abbreviated variable name ¹​internal_node_id