在 R 中下载 plotly graph 的数据
Download data underlying plotly graph in R
我在 Rmarkdown 中使用 plotly。
当我绘制图表时,是否有下载基础数据的方法?
library(plotly)
x <- c(1:100)
random_y <- rnorm(100, mean = 0)
data <- data.frame(x, random_y)
p <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines')
通常在上图中,我想以某种 csv 格式获取数据 data.frame
您可以使用此功能将 CSV 文件嵌入到您的 Rmarkdown HTML 中:yihui.name/en/2018/07/embed-file。
我在 Rmarkdown 中使用 plotly。 当我绘制图表时,是否有下载基础数据的方法?
library(plotly)
x <- c(1:100)
random_y <- rnorm(100, mean = 0)
data <- data.frame(x, random_y)
p <- plot_ly(data, x = ~x, y = ~random_y, type = 'scatter', mode = 'lines')
通常在上图中,我想以某种 csv 格式获取数据 data.frame
您可以使用此功能将 CSV 文件嵌入到您的 Rmarkdown HTML 中:yihui.name/en/2018/07/embed-file。