[R] Problem Writeing a pipe using R (stdin is consumed)
Huntsinger, Reid
reid_huntsinger at merck.com
Mon Feb 24 16:26:04 CET 2003
The named pipe idea works for me:
basically,
$ mknod to_R p
$ echo "test this out" > to_R &
$ R CMD BATCH rtest.R out
where rtest.R is
con <- fifo("to_R", open="r")
print(readlines(con))
Reid Huntsinger
-----Original Message-----
From: Alberto Gobbi [mailto:agobbi at anadyspharma.com]
Sent: Friday, February 21, 2003 2:52 PM
To: R-Help
Subject: RE: [R] Problem Writeing a pipe using R (stdin is consumed)
Thanks for the answer!
However what I would like to ba able to do is something like:
perl -e 'print "1 2\n\2 2\n";' | R --silent commandFile
and commandFile would contain something like:
t<-read.table(file("t"), sep=" ")
print(t*2)
This would need read.table to get the original stdin() and the commands to
be read from a file.
The idea with the named pipe does not work either for the same reasons.
Thanks again,
Alberto
-----Original Message-----
From: M.Kondrin [mailto:mkondrin at hppi.troitsk.ru]
Sent: Friday, February 21, 2003 21:43 PM
To: R-Help
Subject: Re: [R] Problem Writeing a pipe using R (stdin is consumed)
M.Kondrin wrote:
> May be R -slave ... will help?
> man R
> ...
> -q, --quiet
> Don't print startup message
>
> --silent
> Same as --quiet
>
> --slave
> Make R run as quietly as possible
>
> ...
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
$ echo "h<-1; print(h)" | R --slave
[1] 1
$
______________________________________________
R-help at stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
______________________________________________
R-help at stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help
------------------------------------------------------------------------------
More information about the R-help
mailing list