Date: 2023-12-17
# Let's create a sample plot using 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
# Sample data
x <- c(1, 2, 3, 4, 5)
y <- c(10, 14, 18, 24, 30)
# Create a Plotly plot
plot_ly(x = ~x, y = ~y, type = 'scatter', mode = 'lines+markers', name = 'Line plot') %>%
layout(title = 'My Interactive Plot',
xaxis = list(title = 'X-axis'),
yaxis = list(title = 'Y-axis'))