library(tidyverse)
library(ggplot2)
library(scales)
library(ggrepel)
library(ggtext)
library(plotly)
<- read.csv("Data/cars.csv") Car_types
Interactivity
Exercise 11 — PMAP 8551, Summer 2025
Task 1: Session check-in
Three interesting or exciting things:
I can see how using a dashboard post to present interactive data where everyone (in particular people directly involved on a project) can observe its progress (or lack thereof). As Stephanie Evergreen discusses in the readings, it is real-time and interactive data that can be used by anyone. For me, I see this as a great opportunity to share project information in a clear and understandable way, with each person viewin the data can select his areas of interest to view. Excellent tool!
After viewing the video {“making interactivenG graphics”} showing the State of Utah Covid-19 tracking dashboard, it reminded me that the State of Georgia’s Department of Health also had an interactive dashboard. I remember it because I used it multiple times per day during the Covid-19 pandemic as a way of keeping me informed. I did not know what it was at the time, but it was really cool then and even more so now because I know what it is and how it was developed.
Using ggplotly was so cool. Once I figured out that I needed to pass my “Interactive_plot” into the first line, and then intergrate into ggplot, then it worked instantly. Love it!
Three muddy or unclear things:
My concern is that too much information that is placed onto a dashboard can be bad (i.e., not look good, may be cluttered, and can be confusing). The “bad” examples provided in the readings and in the video were awful. I think most people are aware that too much information can distort and confuse the viewer. As long as people are aware of the problem and are careful, I sure it will be fine. I know this is a subjective question, but “when is it too much information”? Is there an accepted criteria, like: limit to one page, 10 variables, or is there another way to determe that its “too much”?
At first (after spending some time playing with the “Shiny” app), I thought the Shiny app looked so cool. The Kmeans example and especially the “movie explorer interactive visualization” example was very interesting. However, after watching the video and hearing that it is not only a powerful tool but it is also very complicated, I got intimidated/worried. In your opinion, as a beginner, is it worth the while to purchase a monthy subscription ($13/month or $145/year) to just try it? I thought getting acquainted with Ai was extremely difficult at first too.., is it worse than learning Ai? Is it that much better than Quarto dashboard? If not, I wont purchase.
I got confused with the many ways that you can share interactive files. The slides/video discussed simple plots with plotly, quarto dashboard, flexdashboard, and shiny. Is quarto and flexdashboard the same as dashboard?
Task 2: Plot data
ggplot(data = Car_types, mapping = aes(x = hwy, y = cty, color = class)) +
annotate(geom = "segment", x = 0, xend = 48, y = 0, yend = 35) +
geom_point() +
geom_label_repel(data = subset(Car_types, manufacturer == "chevrolet" & model ==
"K1500 Tahoe 4wd"),
aes(label =
paste(manufacturer, model)),
nudge_x = 1,
nudge_y = 1) +
scale_color_manual(values = c("grey50", "#0074D9", "#FF4136", "#872657", "#FFA500", "#808000", "#12AD2B")) +
scale_fill_manual(values = c("#0074D9", "#FF4136")) +
annotate(geom = "text", x = 12, y = 2, label = "Gas-Guzzlers",
fontface = "italic", hjust = 0, color = "grey40") +
annotate(geom = "text", x = 15, y = 30, label = "Fuel Efficient Cars",
fontface = "italic", hjust = 0, color = "grey40") +
annotate(geom = "rect", xmin = 30, xmax = 43, ymin = 19, ymax = 30,
fill = "#F9FF33", alpha = 0.15) +
annotate(geom = "rect", xmin = 12, xmax = 22.5, ymin = 8, ymax = 18,
fill = "#F9FF33", alpha = 0.15) +
annotate(geom = "segment", x = 18, xend = 29, y = 28, yend = 28, color = "#FF7433",
arrow = arrow(angle = 14, length = unit(0.6, "lines"))) +
annotate(geom = "segment", x = 17, xend = 17, y = 3, yend = 8, color = "#FF7433",
arrow = arrow(angle = 14, length = unit(0.6, "lines")))
Task 3: Interactive Plots
<- ggplot(data = Car_types, mapping = aes(x = hwy, y = cty, color = class)) +
my_plot geom_point()
ggplotly(my_plot)
<- ggplot(data = Car_types, mapping = aes(x = hwy, y = cty, color = class)) +
my_plot geom_point(aes(text = model))
Warning in geom_point(aes(text = model)): Ignoring unknown aesthetics: text
<- ggplotly(my_plot, tooltip = "text")
Inter_plot_text
Inter_plot_text