Displaying 2 results from an estimated 2 matches for "r_pipe".
2008 Jan 22
1
Communicating with R through a named pipe: display refresh problem
Hello,
On a linux system I'm trying to send commands to R through a named pipe and am *nearly* successful. I can send R commands and can plot graphs. The only problem I have is getting the x11 display to refresh - it appears to hang because of the pipe.
The R server:
$ mkfifo R_pipe
$ R --no-save < R_pipe
The R client:
$ cat>> R_pipe
Now, I can send R commands down the pipe:
Client side:
x <- seq(1,10)
x
Server side:
> x <- seq(1:10)
> x
[1] 1 2 3 4 5 6 7 8 9 10
This is perfect.
Now if I try to create a plot, e.g. plot(1:100), the server sh...
2008 Jan 23
0
R command to refresh graphical output?
...because R is busy interpreting infinite loop.
Is there a way of "manually" refreshing the display? Or is there another way to get around the refresh problem?
Thanks in advance,
PJ
The R server:
# based on http://tolstoy.newcastle.edu.au/R/help/01c/2886.html
stream <- fifo("R_pipe", "r", blocking=FALSE,)
repeat
{
a <- readLines(stream)
if(length(a) != 0)
{
if (inherits(e, "try-error"))
{
# error handling code here
cat("Error", "\n")
}
}
}
The R client:
$ mkfifo R_pipe
$ cat>> R_pipe...