Skip to contents

Each 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)

Arguments

df

a data.frame (a read tabular file)

Value

TRUE when df matches the format, else FALSE.

Details

  • data_check_is_behaverse() – native Behaverse tidy long form (an instrument_id column plus Response channels such as response_numeric, response_time, trial_index).

  • data_check_is_inquisit() – Millisecond Inquisit .iqdat (subject, blockcode, trialcode, latency).

  • data_check_is_jspsych() – jsPsych (trial_type, rt, and trial_index or time_elapsed).

  • data_check_is_psychopy() – PsychoPy Builder (<loop>.thisN/.thisRepN loop counters, <comp>.started/.stopped timing, or psychopyVersion / 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