The RGL package is a visualization device system for R, using OpenGL or WebGL as the rendering backend. An OpenGL rgl device at its core is a real-time 3D engine written in C++. It provides an interactive viewpoint navigation facility (mouse + wheel support) and an R programming interface. WebGL, on the other hand, is rendered in a web browser; rgl produces the input file, and the browser shows the images.
The software is released under the GNU Public License. See “COPYING” for details.
macOS Windows 7/10 Unix-derivatives
R recommended tools (gcc toolchain) On Windows, Rtools40 (or earlier versions for pre-R-4.0.0)
For OpenGL display:
Windowing System (unix/x11 or Windows) OpenGL Library OpenGL Utility Library (GLU)
For WebGL display:
A browser with WebGL enabled. See https://get.webgl.org.
Debian: aptitude install libgl1-mesa-dev libglu1-mesa-dev
Fedora: yum install mesa-libGL-devel mesa-libGLU-devel libpng-devel
rgl should work with either XQuartz 2.7.11 or 2.8.0, but it will
probably need rebuilding if the XQuartz version changes. XQuartz
normally needs re-installation whenever the macOS version changes.
Windows: Windows normally includes OpenGL support, but to get the appropriate include files etc., you will need the appropriate version of Rtools matched to your R version.
The libpng library version 1.2.9 or newer is needed for pixmap import/export support.
The freetype library is needed for resizable anti-aliased fonts. On Windows, it will be downloaded from https://github.com/rwinlib during the install.
Binary builds of
rgl are available for some platforms on CRAN.
For source builds, install the prerequisites as described above, download the tarball and at the command line run
R CMD INSTALL rgl_0.105.22.tar.gz
(with the appropriate version of the tarball). The build uses an
autoconf configure script; to see the options, expand the tarball and
Alternatively, in R run
to install from CRAN, or
to install the development version from Github.
As of version 0.104.1, it is possible to build the package without OpenGL support on Unix-alikes (including macOS) with the configure option –disable-opengl For example,
R CMD INSTALL --configure-args="--disable-opengl" rgl_0.105.22.tar.gz
On Windows, OpenGL support cannot currently be disabled.
library(rgl) browseVignettes("rgl") demo(rgl)
Daniel Adler email@example.com Duncan Murdoch firstname.lastname@example.org Oleg Nenadic email@example.com Simon Urbanek firstname.lastname@example.org Ming Chen email@example.com Albrecht Gebhardt firstname.lastname@example.org Ben Bolker email@example.com Gabor Csardi firstname.lastname@example.org Adam Strzelecki email@example.com Alexander Senger firstname.lastname@example.org The R Core Team for some code from R. Dirk Eddelbuettel email@example.com The authors of Shiny for their private RNG code. Jeroen Ooms for Rtools40 and FreeType help. Yohann Demont for Shiny code, suggestions, and testing. Joshua Ulrich for a lot of help with the Github migration. Xavier Fernandez i Marin for help debugging the build.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.