After using pipe() to view output in less, the pipe becomes invalid:

$ p <- pipe("less")
$ capture.output(1:100, file=p)
$ p
Error in summary.connection(x) : invalid connection
$ close(p)
Error in close.connection(p) : invalid connection

Is this a bug? Other uses of pipe works differently:

$ p <- pipe("echo 4711")
$ x <- scan(p)
Read 1 item
$ x
[1] 4711
$ p
description       class        mode        text      opened    can read
"echo 4711"      "pipe"         "r"      "text"    "closed"       "yes"
  can write
       "no"
$ close(p)
$ p
Error in summary.connection(x) : invalid connection

Cheers
/Ali

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to