To create a sphere, we can use spheres3d function of rgl package. The rgl package is specifically designed to create real-time interactive 3D plots. If we want to create a sphere then we need to pass the values for the three axes and the radius of the sphere. We can also change the color of the sphere by introducing color argument inside spheres3d function.
Loading rgl package and creating a sphere:
> library(rgl) > spheres3d(x=1,y=1,z=1,radius=1)