[R] Need help with pipe()

Ronnen Levinson RML27 at cornell.edu
Fri Nov 22 05:41:35 CET 2002


Hello.

I have an R program that calls gawk (GNU Awk 3.06 for Windows) from
within pipe() to preprocess a large file before it is read into a data
frame with read.table().

I've recently upgraded from Win98SE to WinXP, and have also upgraded
from R1.5.0 to R1.6.1 over the past month or so. This program worked
before the upgrade(s), but now fails. I observe the following sort of
behavior with R1.6.1 under WinXP:

> cat("hello\ngoodbye\n",file="textfile")
> readLines("textfile")
[1] "hello"   "goodbye"
> readLines(pipe("gawk '{print $0}' textfile"))
character(0)
#  Note: R pauses for about 10 seconds before returning "character(0)"
> readLines(pipe("echo hello"))
Error in readLines(pipe("echo hello")) : cannot open the connection
In addition: Warning message:
cannot open cmd `echo hello'
> version
         _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    1
minor    6.1
year     2002
month    11
day      01
language R
>

gawk is in my system path, and I can successfully run it from a command
window.

Hence, I have the following questions:

(1) Is pipe() supported in R1.6.1 under WinXP?
(2) Can anyone suggest how to get pipe("gawk...") to work again?

Thanks,

Ronnen.

P.S. E-mailed cc:s of replies posted to the list would be appreciated.

--
Ronnen Levinson, Ph.D.            \/      RML27 at cornell.edu
scientist                         ||      http://ronnen.com
Lawrence Berkeley National Lab    /\      fax 425.955.1992

======================================
Take my word, the mockingbird'll
sing the saddest kind o' song
he knows things are wrong
and he's right

-- Johnny Mercer, "Blues in the Night"
======================================


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



More information about the R-help mailing list