When it comes to 3D plots, it’s important to be able to view them from different angles to interpret the function or surface that’s been displayed. The rgl package by Adler et al. (2015) offers some fantastic, simple-to-use R functions that allow you to rotate and zoom in on three-dimensional plots with your mouse. In this chapter, you’ll look at a few examples that show off the possibilities of rgl.

Under the hood, rgl utilizes OpenGL—a standard application programming interface—to render the graphics on your computer screen. Install rgl (for example, by calling install.packages("rgl") at the prompt) and then call library("rgl") ...

Get The Book of R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.