This presentation was created as part of a Coursera peer-graded assignment.
It demonstrates an interactive Plotly chart built using R Markdown.
We will use the built-in mtcars dataset to visualize the relationship between miles per gallon and horsepower.
library(plotly)
p <- plot_ly(
data = mtcars,
x = ~hp,
y = ~mpg,
type = "scatter",
mode = "markers",
text = rownames(mtcars),
marker = list(size = 10)
)
p