0 votes
1 view
in R Programming by (5.3k points)

I want to pause my R script until the user presses a key.

How do I do this?

1 Answer

0 votes
by (25.3k points)

You can the following code to prompt a user to press Enter to continue:

readline(prompt="Press [enter] to continue:")

If you don’t want the prompt to print on the console after the Enter key is pressed, wrap the above function in the invisible() function.i.e.,

invisible(readline(prompt="Press [enter] to continue:"))

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...