This presentation was created on 6/4/2026.
It contains an interactive plot created with Plotly.
library(plotly)
library(ggplot2)
The chart below shows the relationship between car weight and miles per gallon using the built-in mtcars dataset.
plot_ly(
data = mtcars,
x = ~wt,
y = ~mpg,
type = "scatter",
mode = "markers",
text = ~paste("Car:", rownames(mtcars),
"<br>MPG:", mpg,
"<br>Weight:", wt),
marker = list(size = 10)
) %>%
layout(
title = "MPG vs Car Weight",
xaxis = list(title = "Car Weight"),
yaxis = list(title = "Miles Per Gallon")
)
## Warning: `arrange_()` was deprecated in dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
This presentation demonstrates how R Markdown can be used to create a webpage presentation with an interactive Plotly chart.