Creating a 3D scatter plot in R so you can see the third dimension (CC083)
Channel: Riffomonas Project
Date: 24/03/2021

In this episode of Code Club, Pat will show you how to create a 3D scatter plot in R without settling for projecting it into only 2D. Pat will demonstrate how to use the RGL package from R to create a static 2D version of the scatter plot, an animated GIF of a rotating scatter plot, and in an interactive version of the plot that you can embed in a web page or html-based slide deck. Be sure to check out the accompanying blog post to play with the interactive 3D ordination yourself! You can find it at https://www.riffomonas.org/code_club/2021-03-24-rgl.

Pat uses RStudio and functions from the ggplot2 package and other packages from the tidyverse.

Do you have a figure that you would like to receive a critique or help improving? Let me know and I'd be happy to arrange a guest appearance!

If you're interested in taking an upcoming 3 day R workshop, email me at riffomonas@gmail.com!

R: https://r-project.org
RStudio: https://rstudio.com
Raw data: https://github.com/riffomonas/raw_data/releases/latest
Workshops: https://www.mothur.org/wiki/workshops

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 2D is a constraint
2:09 3D scatter plot in RGL
10:00 Rendering a 3D figure in 2D (why!?!?)
11:30 Creating a GIF of rotating ordination
15:24 Embedding interactive in web site
17:37 Embedding interactive in HTML-based slide deck
19:33 Conclusion