This project was created as part of the Developing Data Products course of the Coursera Data Science Specialisation
The goal of the project is to create a web page presentation using R Markdown that features a plot created with Plotly, and to host the resulting web page on either GitHub Pages, RPubs, or NeoCities.
The interactive plot on the next slide represents the number of road accidents in Great Britain from 2005 to 2015, grouped by severity (slight, serious, or fatal).
Using the mtcars dataset we plot can attempt to understand the relationship of various factors to gas mileage (mpg).
We plot weight (wt) vs. mileage (mpg) spatially along the x/y axes. We visualize the number of cylinders (cyl) as colors and the amount of horsepower (hp) as the size of an individual point in the plot.
suppressPackageStartupMessages(library(plotly))
plot_ly(data = mtcars, x = ~wt, y = ~mpg,
color = ~as.factor(cyl), size = ~hp,
text = ~paste("Weight: ", wt, '<br>MPG:', mpg),
type = "scatter", mode = "markers") %>%
layout(title = "Car Data")
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.