Make R (statistics package) wait for keyboard prompt when run within a bash script

前端 未结 5 1038
别跟我提以往
别跟我提以往 2021-02-15 13:14

I am using R to generate a series of plots within a loop, with the user hitting the enter key to indicate they have seen the plot and it is time to move on. These are interacti

5条回答
  •  误落风尘
    2021-02-15 13:44

    I'm not sure if there is an easy way to wait a keyboard input, but at least you can wait mouse click.
    Not elegant but try this script:

    quartz() # or maybe windows() in windows
    for (i in 1:5) {plot(i, i); locator(1)}
    

提交回复
热议问题