Running R Scripts with Plots

后端 未结 5 1298
情书的邮戳
情书的邮戳 2020-12-09 02:36

I have a small shell script (bash) which runs a R script which produces a plot as output. Everything works fine but immedietly after the plot is rendered R quits. Is there a

5条回答
  •  时光说笑
    2020-12-09 03:14

    You could add a loop that checks for the graphical device every n seconds:

    while (!is.null(dev.list())) Sys.sleep(1)
    

    This will sleep until you close the plot window.

提交回复
热议问题