I have a for loop and I want it to only go to the next "i"-value when you hit enter in the console. So I wrote this:
for (i in 1:5){
print(i)
UserInput <- readline(prompt = "Press enter to continue.")
if (UserInput != "ENTER"){ #Obviously "ENTER" is incorrect, but something like that.
break
}
}
Any clues?
A simple solution is:
for (i in 1:5){
readline(prompt=i) }