From the course: R: Interactive Visualizations with htmlwidgets
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Make ggplot2 interactive using Plotly - R Tutorial
From the course: R: Interactive Visualizations with htmlwidgets
Make ggplot2 interactive using Plotly
- [Narrator] Plotly has the ability to automatically convert a wide range of ggplot2 charts into interactive plotly charts with almost no effort at all. Let's look at how we can go about doing that in our studio. Inside of our exercise files we have a file called GG plot two conversion dot R. Let's open that up okay. At the top of the script file we can see we load the library tidyverse. Let's run that with command enter, and the tidyverse library simply loads the most frequently used libraries from the tidyverse ecosystem. Then on line three, I use the function load, to load the dot R data set, which is called British weather. Then, line five through 18, I use dplyr and then ggplot2 to build up a static chart. Lets run this code with command enter to see how it looks. So I have a nice, attractive looking static ggplot2 output here. I can see I have a scatter plot, with straight lines joining my markers, my X axis is labeled month, my Y axis is labeled mean daily temperature…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
What is the Plotly library?9m 50s
-
Make ggplot2 interactive using Plotly7m 27s
-
Create interactive stacked bar charts9m 3s
-
Interactive scatter, line, and bubble charts with Leaflet8m 15s
-
Create interactive maps8m 47s
-
Specify custom colors7m 11s
-
Customize tooltips4m 33s
-
Combine multiple charts7m 18s
-
Extract click information from Plotly6m 22s
-
-
-
-
-