- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a sphere in R?
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.
Example1
Loading rgl package and creating a sphere:
> library(rgl) > spheres3d(x=1,y=1,z=1,radius=1)
Output:
Example2
> spheres3d(0,0,0,radius=1,color="blue")
Output:
Example3
> spheres3d(0,0,0,radius=1,color="red")
Output:
- Related Articles
- How to create a Sphere (3D) in JavaFX?
- How to create a polynomial model in R?
- How to create a Venn diagram in R?
- How to create a frequency polygon in R?
- How to create a sparse matrix in R?
- How to create a dummy variable in R?
- How to create a staircase plot in R?
- How to create a covariance matrix in R?
- How to create permutations as a list in R?
- How to create a histogram using weights in R?
- How to create a list of matrices in R?
- How to create a horizontal boxplot in base R?
- How to create a vector of lists in R?
- How to create reverse of a number in R?
- How to create a hierarchical cluster dendrogram in R?

Advertisements