I want to write a R script, where I give an input at some point. I want to run it in Rstudio. I do:
print("hi")
readline("Press a key to continue")
print("ho")
But the script does not stop and readline returns "".
I figured it is probably because my session is not "interactive". Is there a readline which will work for non-interactive processing? Or can I make my script interactive?
EDIT:
How to wait for a keypress in R? is not a duplicate, I even use the method "readline" stated in the accepted answer in my minimal failing example.