[R] Need help with pipe()

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Fri Nov 22 07:54:20 CET 2002


Your example works for me on R 1.6.1 (the binary on CRAN) and Windows XP.

Pipes do work differently on Windows NT and 16-bit Windows (95/98/ME),
but they generally work better on NT.  (XP is the marketing name
for NT5.1.)

On Thu, 21 Nov 2002, Ronnen Levinson wrote:

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

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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