Re: [R] R more Unix-like?

From: Steve Miller <steve.miller_at_jhu.edu>
Date: Thu 11 May 2006 - 20:28:47 EST


You can use the pipe command to read data:  

msci <- read.table(pipe("python steve/python/msciintl.py"),sep=",",header=T, as.is=T)  

I use this metaphor quite a bit for loading data.  

Steve Miller    

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Robert Citek Sent: Wednesday, May 10, 2006 9:02 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R more Unix-like?    

Is there a way to stream data into R so that it can be used in a

command pipe?  

Most Unix commands read data via standard input and read the script

from the command line. For example:  

$ seq 1 10 | sed -e 's/^/foo /'

$ seq 1 10 | awk '{print "foo " $1}'

$ seq 1 10 | perl -lane 'print "foo $F[0]"'
 

In contrast, R seems to read the script from standard input, thereby

preventing streaming data through that file descriptor. In reading

through the man page for R and R-intro.html I haven't seen anything

obvious to change this behaviour. Is it possible?  

Pointers to references would be greatly appreciated.  

Regards,

http://www.cwelug.org/downloads

Help others get OpenSource software. Distribute FLOSS

for Windows, Linux, *BSD, and MacOS X with BitTorrent  


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

        [[alternative HTML version deleted]]



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 Received on Thu May 11 21:11:19 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 11 May 2006 - 22:10:05 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.