Re: [R] Question Regarding 'pipe'

From: Jan T. Kim <>
Date: Tue, 08 Apr 2008 10:45:10 +0100

On Mon, Apr 07, 2008 at 07:42:50PM -0500, wrote:
> Can anyone point out why this is not working?
> y<-read.table(pipe(' awk '{ n = $1; sub( ".*" $1 " " ,"") ; while ( n-- )


> print }' temp.txt '))

one problem is that your single-quoted R string contains single quotes which I've pointed to with "^" above. You probably intend these single quotes to be part of the awk command line, but R can\'t know that unless you escape them... ;-)

In the future, can you please describe explicitly how it "is not working", and also give a bit more context, such as a few lines of description of the content of temp.txt, and why you're trying to use awk (rather than R itself) to achieve whatever you're trying to achieve?

Best regards, Jan

 +- Jan T. Kim -------------------------------------------------------+
 |             email:                               |
 |             WWW:             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 08 Apr 2008 - 09:47:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Apr 2008 - 12:30:26 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive