RGL : A R-library for 3 D visualization with OpenGL

RGL is a library of functions that offers three-dimensional, real-time visualization functionality to the R programming environment. It ameliorates a shortcoming in the current version of R (and most other statistical software packages), namely the inability to allow the user to conveniently generate interactive 3D graphics. Since 3D objects need to be projected on a 2D display, special navigation capabilities are needed to provide insight into 3D relationships. Features such as lighting, alpha blending, texture mapping and fog effects are used to enhance the illusion of three-dimensionality. Additional desirable features for interactive data analysis in 3D are the ability to rotate objects, and to zoom in/out so as to examine details of an object, or alternatively, to view it from a distance. The goal of the project described here was to provide a “3D engine” with an API (Application Programming Interface) designed for R. It is implemented as a portable shared library (written in C++) that uses OpenGL. The syntax of the RGL commands has been based on that of the related and familiar standard R commands, thus ensuring that users familiar with the latter can quickly learn the usage of RGL. This paper outlines the capabilities of the of the RGL library and illustrates them using some typical statistical applications.