Re: [R] Problem Writeing a pipe using R (stdin is consumed) <F71FE60EC95F164BB32C51B0E7A9C4C7163DFB@eggs.anadys.anadyspharma.com>

About this list Date view Thread view Subject view Author view Attachment view

From: A.J. Rossini (rossini@blindglobe.net)
Date: Sat 22 Feb 2003 - 08:48:33 EST


Message-id: <87vfzdgv9q.fsf@jeeves.blindglobe.net>


Instead of piping the data through, have R read it in from a file?
Then you just specify the data file name within read.table in the
string, and the only downside might be an additional "temporary" file
to clean up.

It seems to solve the problem as you've described it, though not in
the way you want.

"Alberto Gobbi" <agobbi@anadyspharma.com> writes:

> 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@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@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@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

-- 
A.J. Rossini				Rsrch. Asst. Prof. of Biostatistics
U. of Washington Biostatistics		rossini@u.washington.edu	
FHCRC/SCHARP/HIV Vaccine Trials Net	rossini@scharp.org
-------------- http://software.biostat.washington.edu/ ----------------
FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email
UW:   Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX
(my tuesday/wednesday/friday locations are completely unpredictable.)

______________________________________________ R-help@stat.math.ethz.ch mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:22 EST