RGL is a package in which functions for performing three-dimensional plotting are condensed. Three-dimensional plots can be created, and the plotted figures can be moved with the mouse, and enlargement / reduction can be performed.
Here is an example of the instructions from installing the package to displaying example. After plotting, you can rotate the figure by moving the mouse while holding the figure with the left click, or zoom in and out of the figure by turning the mouse wheel.
install.packages("rgl") library(rgl) open3d() example(rgl.surface) for(i in 1:360) rgl.viewpoint(i, 1/4)