Reply To: Troubleshooting

PennController for IBEX Forums Troubleshooting Reply To: Troubleshooting


Hi, Jeremy.
I want to design a masked priming experiment and I’ve been trying to use the template masked priming experiment in the projects part to understand how it works (I’m new to coding!). One problem that I’m having is that I can’t use the code that you mention in the advanced tutorial section to tidy the results so that I can calculate the RTs. I’m trying this code:

tidied_results <- results %>%
  filter(PennElementName == "target" | PennElementName == "answerTarget") %>%
  select(Group, Condition, Expected, PrimeType, PennElementName, Value, EventTime) %>%
  group_by(Group, Condition) %>% 
  mutate(event = case_when(PennElementName == "target" ~ "target_onset_time",
                           PennElementName == "answerTarget" ~ "selection_time"),
         selection = case_when("F" %in% Value ~ "word",
                               "J" %in% Value ~ "non-word",
                               FALSE ~ NA_character_),
         EventTime = if_else(EventTime == "Never", NA_real_, suppressWarnings(as.numeric(EventTime)))) %>%
  ungroup() %>% 
  select(-PennElementName, -Value) %>%
  pivot_wider(names_from = event, values_from = EventTime)

tidied_results %>% view()

The problem is that I get more than one value in the ‘target_onset_time’ and ‘selection_time’ columns.
What am I doing wrong?