This presentation explores the relationship between car speed and stopping distance using R and Plotly.
library(plotly)
data(cars)
plot_ly(
data = cars,
x = ~speed,
y = ~dist,
type = "scatter",
mode = "markers",
marker = list(
color = "blue",
size = 10
)
) %>%
layout(
title = "Car Speed vs. Stopping Distance",
xaxis = list(title = "Speed (mph)"),
yaxis = list(title = "Stopping Distance (feet)")
)
The graph shows that stopping distance generally increases with car speed.
This project demonstrates how R Markdown and Plotly can create interactive data visualizations.