Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R rgl package error while loading the library

Tags:

r

rgl

My system environment:

Mac OS 10.10.2

X11 (XQuartz 2.7.5)

R 3.1.2

When I load and use 'rgl' package, I get following error message.

> library("rgl",lib.loc="/Library/Frameworks/R.framework/Versions/3.1/Resources/library")
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: In fun(libname, pkgname) : error in rgl_init
> plot3d(x,y,z)
Error in rgl.open(useNULL) : rgl.open failed

What's the problem?

like image 774
user67275 Avatar asked Jan 09 '23 21:01

user67275


2 Answers

I was already using rstudio when I got this warning. This seemed to work for me as suggested on https://cran.r-project.org/web/packages/shinyRGL/README.html.

  1. I ran this on R console options(rgl.useNULL=TRUE)
  2. I restarted the session using .rs.restartR()
  3. Loaded the library again: library("plot3Drgl")

HTH ...

like image 133
HVakade Avatar answered Jan 11 '23 18:01

HVakade


rgl appears to be working with RStudio. I'd make sure you have XQuartz installed on your system https://xquartz.macosforge.org/landing/ as X11 is no longer included with OS X by default. Let us know if it's still not working for you.

like image 36
Md. Sahidul Islam Avatar answered Jan 11 '23 17:01

Md. Sahidul Islam