This presentation demonstrates an interactive data product created using R Markdown and Plotly.
January 2026
This presentation demonstrates an interactive data product created using R Markdown and Plotly.
We use the built-in mtcars dataset.
The interactive plot below shows the relationship between car weight and MPG.
library(plotly)
plot_ly( data = mtcars, x = ~wt, y = ~mpg, type = “scatter”, mode = “markers”, color = ~as.factor(cyl), text = ~paste(“Horsepower:”, hp) )
A simple linear regression model is used to predict MPG based on
weight and horsepower. model <- lm(mpg ~ wt + hp, data = mtcars) summary(model)$coef
This presentation includes:
A recent date
An interactive Plotly visualization
A reproducible R Markdown presentation
```{r, echo=FALSE} head(mtcars)