DT:有没有办法在 google colab 中使用 r 作为交互式表格来显示数据帧?

Bah*_*482 6 r dataframe dt google-colaboratory

您是否知道使用 R 在 colab 中显示数据框的“好”方法,最好是作为交互式表格?我正在尝试下面的代码(我通常在 rstudio 中使用),但它在 colab 中不起作用。

library(datasets)

data(iris)

library(DT)
DT::datatable(iris) #this typically displays a beautiful interactive html table, but not working with colab


#these display a simple table
View(iris)

fix(iris)
Run Code Online (Sandbox Code Playgroud)

我做了一些搜索,看起来有一种很好的方法可以在 python 下的 colab 中显示带有过滤器的交互式表https://colab.research.google.com/notebooks/data_table.ipynb#scrollTo=jcQEX_3vHOUz

但我找不到 R 的类似内容。您有什么建议吗?

谢谢

Was*_*ann 1

好问题!

到目前为止我找到了两个选择:

  1. 一个奇特的:(reactable::reactable()见链接)
  2. 一个简单的:(rmarkdown::paged_table()见链接)