I have a dataframe where I would like to check if people identified their right theme from a memory test. Each participant saw a different stimuli(s), so doing so is slightly more complicated than I expected. The first participant, for instant, saw the suicide, the memory, and the time themes, so if they have a 1 in those variable columns thats good. If they have a 1 in a column that they didn't see, thats bad. For instant, participant 1 below correctly identified all of their images, because they were shown suicide, memory, and time, and have a 1 in that column, and a 0 in the other columns. However the next participant said they saw the memory column but didnt. I would like to create four additional columns that show 1 if they got the theme correctly (saw the theme and marked 1 or didnt see the theme and marked 0), and 0 if they got it incorrect (saw the theme and marked it 0 or didn't see the theme and marked it 1).
I'm a little at a loss on how to do this and appreciate the help!!!
list <- c("suicide memory time","suicide vomit time","vomit alcohol time"," ",
" ","alcohol suicide children")
id <- c(1:6)
suicide<- c(1,1,0,0,0,1)
memory <- c(1,0,0,0,0,0)
alcohol<- c(0,1,1,1,1,1)
time<- c(1,0,1,1,1,0)
foil1<- c(0,0,0,0,0,0)
foil2 <- c(0,0,1,0,0,0)
df<- data.frame(list,id,suicide,memory,alcohol, time, foil1, foil2)
How do I create 4 new columns: suicide_score memory_score... etc that show 0/1 for each participant based on what they actually saw?