Clean raw choice strings from jsPsych CSV output
process_choices.RdStrips file-path prefixes, surrounding brackets, quotes, and the file
extension from the choices column as exported by jsPsych. The
result is a plain comma-separated string of bare stimulus names suitable
for downstream splitting and matching.
Value
Character vector of the same length as choices, with
brackets, quotes, path prefixes, and the extension removed.
Examples
raw <- c(
"[\"assets/stimuli/cat.png\",\"assets/stimuli/dog.png\"]",
"[\"resources/apple.png\",\"resources/banana.png\"]"
)
process_choices(raw)
#> [1] "cat,dog" "apple,banana"
# [1] "cat,dog" "apple,banana"