I have a data frame df with 100 rows. I am trying to make it so that if certain column values in each row equal certain things, I change another column value.
So in this example, for each row in the data frame, if the "subject" column value is = s002 and Deviant = 101 and Correct = 222, I want the column of "Correct Final" to be changed to 1
for (i in 100) {
df$CorrectFinal<- if (df$subject == "s002" && df$Deviant == 101 &&
df$Correct == 222) (df$CorrectFinal == 1) else (df$CorrectFinal == 0)}