I really enjoy the interactive plots, they are what I am used to seeing when I look online and see plots that really draw my attention. Something about being able to look through different statistics and get a different perspective is really interesting to me and I think it helps with comparisons. My favorite data visualization website, the same that used for the first the data critique has so many interactive visuals where you can switch between different statistics and even compare between two different players in the same visualization. The one that we went over in class with unemployment felt the same way, there was so much data and it could either be very cluttered with lots of information showing or very sparse, looking at one piece of data on its own. This offered a different perspective where it was possible to either compare or really focus on one thing that you found interesting, which I really enjoy.
library(tidyverse)
library(plotly)
data <- read_csv('/Users/dominicrichard/Desktop/nfl.csv')
Do the following:
geom_point()).ggplot(data, aes(x=Att, y=Yds, color= TD)) +
geom_point() +
scale_color_gradient(low = 'blue', high = 'red') +
theme_minimal()
ggplotly().plot <- ggplot(data, aes(x=Att, y=Yds, color= TD, size = TD)) +
geom_point(aes(text = Player)) +
scale_color_gradient(low = 'blue', high = 'red') +
theme_minimal() +
labs(x = "Rushing Attempts",
y = "Rushing Yards")
## Warning in geom_point(aes(text = Player)): Ignoring unknown aesthetics: text
interactive_plot <- ggplotly(
plot, tooltip = "text"
)
interactive_plot
Good luck and have fun!
Install the {flexdashboard} package and create a new R Markdown file in your project by going to File > New File… > R Markdown… > From Template > Flexdashboard.
Using the documentation for {flexdashboard} online, create a basic dashboard that shows a plot (static or interactive) in at least three chart areas. Play with the layout if you’re feeling brave.