
Detect trial-level behavioural-data source formats
Source:R/data_check_helpers.R
data_check_is_behaverse.RdEach function reports whether a data frame is an export from a particular
trial-level format, from its reserved column names. Used by codebook_check to
recognise paradata (response times, trial/stimulus channels) and normalise it
to the Behaverse trial schema rather than treating it as scale items.
Usage
data_check_is_behaverse(df)
data_check_is_inquisit(df)
data_check_is_jspsych(df)
data_check_is_psychopy(df)Details
data_check_is_behaverse()– native Behaverse tidy long form (aninstrument_idcolumn plus Response channels such asresponse_numeric,response_time,trial_index).data_check_is_inquisit()– Millisecond Inquisit.iqdat(subject,blockcode,trialcode,latency).data_check_is_jspsych()– jsPsych (trial_type,rt, andtrial_indexortime_elapsed).data_check_is_psychopy()– PsychoPy Builder (<loop>.thisN/.thisRepNloop counters,<comp>.started/.stoppedtiming, orpsychopyVersion/frameRate/expName); machinery is matched by these suffixes, not a fixed column list, because PsychoPy column names are study-specific.
E-Prime is detected from file text, not a data frame (see
.bh_parse_eprime()), because its export is a header + Level: 3 frames
rather than a flat table.
Examples
df <- data.frame(trial_type = "html-keyboard-response", trial_index = 0:2,
time_elapsed = c(1200, 2500, 3900), rt = c(512, 640, 498))
data_check_is_jspsych(df)
#> [1] TRUE
data_check_is_psychopy(df)
#> [1] FALSE
data_check_is_inquisit(df)
#> [1] FALSE
data_check_is_behaverse(df)
#> [1] FALSE