Skip to content
Back to formatted view

Raw Message

Message-ID: <200107191611.MAA00219@cattell.psych.upenn.edu>
Date: 2001-07-19T16:11:59Z
From: Jonathan Baron
Subject: Write a script

>Dear R users,
>I would like to write a script to launch R commands from a Unix prompt but I
>do not have any idea how to do it. Can someone bring me help please?
>Thanks in advance
>Denis Choquet

I'm sure there are many ways to do this, but one is to write the
script, say myscript.R, just as a list of R commands, and then
write, on the command line:

R --vanilla < myscript.R

See the bottom of http://finzi.psych.upenn.edu/~baron/
for a couple of examples.  The "vanilla" prevents R from reading
various files, which, if they run, will lead it to present
various prompts, etc.  (See R --help for details.)

Jon Baron
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._