Standardise a legacy triadic comparison dataset
read_legacy.RdReads a single CSV file from a legacy triplet experiment and converts it to the standard column format used by this package. Unrecognised or missing columns are derived where possible from the data that are present; see the Column mappings section below for full details. Two output files are written alongside the input: a standardised data CSV and a stimulus-level mapping CSV.
Value
A list returned invisibly with two elements:
data_filePath of the written standardised data CSV (input filename with
_v2025.csvsuffix).levels_filePath of the written stimulus-level mapping CSV (input filename with
_2025_levels.csvsuffix).
Output columns
p_idCharacter participant identifier.
CenterCharacter label of the target (reference) stimulus.
LeftCharacter label of the left-hand choice stimulus.
RightCharacter label of the right-hand choice stimulus.
AnswerCharacter label of the chosen stimulus.
headInteger (0-indexed) factor code for
Center, ordered alphabetically across all unique stimuli inCenter,Left, andRight.winnerInteger factor code for
Answer, using the same ordering ashead.loserInteger factor code for the unchosen option, using the same ordering as
head.RTNumeric reaction time.
NAif not present in the input.sampleAlgCharacter sampling algorithm label:
"random","check","validation","uncertainty", orNA.sampleSetCharacter set label:
"train"or"test".
Column mappings
Input column names are matched case-insensitively and ignoring punctuation.
- Participant ID (
p_id) Recognised input names:
sessionID,session_ID,puid,Participant.ID,worker_id,sub_id,pid. If none are found, participants are assigned sequential IDs ("P1","P2", ...).- Center
Recognised input names:
Center,Target.- Left
Recognised input names:
Left,Option1.- Right
Recognised input names:
Right,Option2.- winner / loser
Recognised input names:
winner/primaryandloser/alternate. Derived fromAnswer,Left, andRightwhen absent.- sampleAlg
Recognised input names:
sampleAlg,AlgSample. Values are recoded:"Random"→"random";"Test"→"validation";"check"→"check";"uncertainty"→"uncertainty". Filled withNAwhen absent.- sampleSet
Recognised input names:
sampleSet,Alg.Label,TrnTest. When absent, 10\ randomly assigned to"test"and the remainder to"train"(seed2025).