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:"))