Skip to content
Prev 2449 / 398506 Next

source("filename") vs. input from command-line

On Wed, 21 Apr 1999, Alex Buerkle wrote:
BR> Version? OS?  On my R-0.64.0 on Solaris I can do this ...

I am using R-0.63.3 on linux-x86.
BR> The NL is only used to break up input: this is saying that what it
BR> has seen so far is syntactically incomplete.  Is this a standard
BR> Unix text file (if you are on Unix)?

It is a standard text file.  If it were syntactially incomplete, sourcing
it from the R prompt would fail, but it doesn't.
What I have ended up doing is calling R from PERL or the command line
with the following:

echo "source ('tmp0.r')" | R --no-save --no-restore

This works.  

I am still not clear on why the command-line redirection did not work
(R --no-save --no-restore < tmp.r).  Is there a difference between how
R handles input received from a unix pipe versus from redirection?

- Alex

~^^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
C. Alex Buerkle                 Ph:  812-855-9018
Jordan Hall 142                 Fax: 812-855-6705
Department of Biology		
Indiana University
Bloomington, IN 47405    cbuerkle at bio.indiana.edu


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._