[R] Why doesnot Rscript work ?

2009-12-14 Thread z_axis
%cat stock.R #! /usr/local/bin/Rscript args - commandArgs(TRUE) args x - read.csv(000301.csv) matplot(x[,1],x[,-1],type=l) #q(save=no) %Rscript stock.R 000301.csv [1] 000301.csv matplot doesnot draw anything(no drawing window). Howeve, in R, source works great! source(stock.R) Sincerely! --

Re: [R] Why doesnot Rscript work ?

2009-12-14 Thread Romain Francois
Hi, Rscript is meant for non-interactive use, so the default device is not the same as when you run R. If you really want a window, open it yourself by calling the appropriate function (X11, windows, ... ) or reset the device option to whichever device you want to use, but it will disappear

Re: [R] Why doesnot Rscript work ?

2009-12-14 Thread Prof Brian Ripley
On Mon, 14 Dec 2009, z_axis wrote: %cat stock.R #! /usr/local/bin/Rscript args - commandArgs(TRUE) args x - read.csv(000301.csv) matplot(x[,1],x[,-1],type=l) #q(save=no) %Rscript stock.R 000301.csv [1] 000301.csv matplot doesnot draw anything(no drawing window). Incorrect: it plots on the