I know an answer for Unix that can perhaps you can translate to DOS.  
If you pass a file of R statements to 'R' on the command line it will  
run them. In Unix, the '|' (pipe) symbol sends text to a program as  
though it came from a file, thus:
        echo "x<-2; 2*x" | R --vanilla --slave
yields
        [1] 4

Or you could put "x<-2; 2*x" in a file called test.R and run:
        R --vanilla --slave < test.R

I use this to interpret user commands from labsynch wiki pages on the  
server ( I learned this from Alfredo Pontillo's R-php). You can run  
any R command, including loading other files and libraries. I use it  
to pass files and set the working directory.

John

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to