Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R rgl package installation warning error

Tags:

r

> library(rgl)

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: In fun(libname, pkgname) : error in rgl_init

I also tried plot3d functions and I got the error:

Error in rgl.open(useNULL) : rgl.open failed

How to resolve it?

like image 286
Priya Avatar asked Feb 10 '26 18:02

Priya


1 Answers

Your previous questions indicate that you're on Ubuntu: rgl depends on some gl packages to function.

What you may not know: you can install r-cran-rgl as a package

$ sudo apt-get install r-cran-rgl

That will install all necessary dependencies and allow you to just load the package in R. It would probably be helpful to run remove.packages("rgl") from R first so that you have the correct version.

like image 83
Derwin McGeary Avatar answered Feb 13 '26 07:02

Derwin McGeary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!