首页 > 解决方案 > 如何在 colab R 中运行 plotly 库

问题描述

我在 google colaboratory 中使用 R。我想使用 ploly 库,但它不提供图表。我正在使用以下代码:

library(plotly)

fig <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)

fig

它给了我输出

No trace type specified:
  Based on info supplied, a 'scatter' trace seems appropriate.
  Read more about this trace type -> https://plotly.com/r/reference/#scatter

No scatter mode specifed:
  Setting the mode to markers
  Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode

No trace type specified:
  Based on info supplied, a 'scatter' trace seems appropriate.
  Read more about this trace type -> https://plotly.com/r/reference/#scatter

No scatter mode specifed:
  Setting the mode to markers
  Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode

并且没有提供图表。是否可以在 R colab 中使用 plotly ?

标签: rplotlygoogle-colaboratory

解决方案


推荐阅读