tjmahr / lookr

Scripts for looking-while-listening and visual-world eyetracking experiments
Other
7 stars 2 forks source link

don't use trial number as row number #17

Closed tjmahr closed 8 years ago

tjmahr commented 8 years ago
  # (3) Assign image names onto stimulus types.
  .GetStimImg <- function(i, j) {
    stim <- sub_stim[i, j]
    str_sub(stim, 1, -2)
  }

  sub_stim <- within(sub_stim, {
    Target           <- mapply(.GetStimImg, TrialNo, Target)
    SemanticFoil     <- mapply(.GetStimImg, TrialNo, SemanticFoil)
    PhonologicalFoil <- mapply(.GetStimImg, TrialNo, PhonologicalFoil)
    Unrelated        <- mapply(.GetStimImg, TrialNo, Unrelated)
  })

This code uses df$TrialNo to determine the row number. This technique was okay back when TrialNo was defined by using row numbers. We quit doing that a few commits ago 18d5336f7de9 because we ran into some weird data where the first row was the data for trial number 2.