## Interactive Plot with Plotly

This is an example of an interactive plot created with the Plotly package in R.

Load necessary libraries

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
library(ggplot2)

Create a sample plot using ggplot2 and convert it to a Plotly plot

p <- ggplot(mpg, aes(x = displ, y = hwy, color = class)) +
  geom_point()

ggplotly(p)