lgautier / Rif.jl

Julia-to-R interface
GNU General Public License v2.0
54 stars 25 forks source link

ggplot2 doesn't open a graphic windows #7

Open diegozea opened 11 years ago

diegozea commented 11 years ago

But, plot() works fine:

julia> using Rif

julia> initr()
Using R_HOME=/usr/lib/R
0

julia> R("library(ggplot2)")
RArray{ASCIIString,1}(Ptr{Void} @0x0000000006a3b8f8)

julia> R("qplot(1:4,1:4,geom=\"point\")")
RArray{Sexp,1}(Ptr{Void} @0x0000000006ffefe0)
lgautier commented 11 years ago

I don't have access to a recent install of Julia+Rif when writing this. This might be because R is in "non-interactive" mode, and then the plot are created in a file located in the current working directory. R("dev.off()") would then be needed to ensure that the file is complete.

diegozea commented 11 years ago

Calling dev.off() gives an error and Julia crashes after that:

julia> R("dev.off()")
Error en dev.off() : cannot shut down device 1 (the null device)

 *** caught segfault ***
address (nil), cause 'memory not mapped'

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 2
dzea@deepthought:~$ 

There isn't not new file on the working directory.

randy3k commented 10 years ago

Try this

R("print(qplot(1:4,1:4,geom=\"point\"))")

But I think there is still another problem here. I am using Mac, and the quartz window freezes when I plot, doesn't matter plot or qplot.