library(plotly)
## Warning: 程序包'plotly'是用R版本4.4.3 来建造的
## 载入需要的程序包:ggplot2
## Warning: 程序包'ggplot2'是用R版本4.4.3 来建造的
##
## 载入程序包:'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
# 创建一个简单的 Plotly 图表
set.seed(123)
data <- data.frame(x = rnorm(100), y = rnorm(100))
p <- ggplot(data, aes(x = x, y = y)) +
geom_point() +
theme_minimal()
ggplotly(p)