Introduction

This is an interactive web presentation created using R Markdown and Plotly.
It explores the relationship between car weight and fuel efficiency (MPG) using the mtcars dataset.


Dataset

data(mtcars)
head(mtcars)

Interactive Plot (Plotly)

library(plotly)
## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
p <- plot_ly(
  data = mtcars,
  x = ~wt,
  y = ~mpg,
  type = "scatter",
  mode = "markers",
  text = ~paste("Car:", rownames(mtcars),
                "<br>Weight:", wt,
                "<br>MPG:", mpg)
)

p

Conclusion


Date

This document was created on:

2026-05-07