R.pl hangs in debian linux
"Bob Ly" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
So I've been trying the R package from Swipl Git, but the example
given in the package just hangs.
:- ensure_loaded(library('R')).
rtest :-
r_open,
y <- rnorm(50),
r_print( y ),
x <- rnorm(y),
r_in( x11(width=5,height=3.5) ),
r_in( plot(x,y) ),
write( "Press Return to continue..." ), nl,
read_line_to_codes( user_input, _ ),
r_print( "dev.off()" ),
Y <- y,
write( y(Y) ), nl,
findall( Zx, between(1,9,Zx), Z ),
z <- Z,
r_print( z ),
cars <- c(1, 3, 6, 4, 9),
r_in(pie(cars)),
write( "Press Return to continue..." ), nl,
read_line_to_codes( user_input, _ ),
r_close.
I tried single quotes in the above code but it would not compiled correctly.
[rexample].
% library(pairs) compiled into pairs 0.00 sec, 22 clauses
% library(lists) compiled into lists 0.01 sec, 122 clauses
% library(shlib) compiled into shlib 0.00 sec, 39 clauses
% library(option) compiled into swi_option 0.00 sec, 32 clauses
% library(readutil) compiled into read_util 0.01 sec, 114 clauses
% library(process) compiled into process 0.00 sec, 38 clauses
% library(R) compiled into r_session 0.04 sec, 486 clauses
% rexample compiled 0.04 sec, 491 clauses
true.
Then I called rtest. and it just hangs. I check if the x11 window
opened, which it did not. I get the following when I list the process:
4516 pts/1 00:00:28 evince
4520 pts/1 00:00:00 dbus-launch
4785 pts/1 00:00:00 sudo
4787 pts/1 00:00:00 su
4795 pts/1 00:00:00 bash
5182 pts/1 00:00:00 swipl
5183 pts/1 00:00:00 R
5185 pts/1 00:00:00 R <defunct>
5230 pts/1 00:00:00 swipl
5231 pts/1 00:00:00 R
5233 pts/1 00:00:00 R <defunct>
5243 pts/1 00:00:00 swipl
5244 pts/1 00:00:00 R
5246 pts/1 00:00:00 R <defunct>
5256 pts/1 00:00:00 ps
I tried the R code in an interactive R session and it worked.
My SWI-Prolog version is as follows:
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.5.2)
My R version is as follows:
R version 3.0.1 (2013-05-16) -- "Good Sport"
Platform: x86_64-unknown-linux-gnu (64-bit)
And finally, I'm running the following linux version:
Linux version 3.2.0-4-amd64 ([email protected])
(gcc version 4.6.3 (Debian 4.6.3-14))
I've only read that there was issues with OSX from mac regarding x11.
Still I tried the r_open(with(non-interactive)) option and I still get
the same result.
Best Regards,
Bob Ly