I am trying to solve a quiz using R, but my code does not work properly. I tried debugging, but it seems that the ifelse statement fails to work at certain numbers that seem
The ifelse syntax should be
ifelse
switches <- rep("off", 100) for(i in 1:100){ k <- seq(i, 100, i) switches[k] <- ifelse(switches[k] == "off", "on", "off") }