vendredi 15 janvier 2021

R if-else statement is not working properly [closed]

I would like to make some constraints and would like each picture to be linked to a button response. So I made some if else statements, but when I run them, it doesn't give me the right conditions. Do you have any idea what is actually wrong following? Thanks in advance

if (test$stimulus == "1_1.bmp") {
  test$corr_res == "c"
} else if (test$stimulus == "1_2.bmp") {
  test$corr_res == "m"
} else if (test$stimulus == "1_3.bmp") {
  test$corr_res == "c"
} else if (test$stimulus == "1_4.bmp") {
  test$corr_res== "m"
} else if (test$stimulus == "1_5.bmp") {
  test$corr_res == "c"
} else if (test$stimulus == "1_6.bmp") {
  test$corr_res == "c"
} else if (test$stimulus == "1_7.bmp") {
  test$corr_res == "m"
} else if (test$stimulus == "1_8.bmp") {
  test$corr_res == "m"
}

Aucun commentaire:

Enregistrer un commentaire