If you use the Rscript command (which is better suited for this purpose), you run it like this:
#!/usr/bin/Rscript
daq = read.table(file('mydata.dat'))
X11()
pairs(daq)
message("Press Return To Continue")
invisible(readLines("stdin", n=1))
Make sure to set the execute permission on myscript.r, then run like:
/path/to/myscript.r
or without the shebang:
Rscript /path/to/myscript.r
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…