是否可以将我在RStudio中使用View()
命令时看到的页面保存为某些数据作为html文件?
答案 0 :(得分:5)
也许您的数据看起来像是mtcars数据
data(mtcars)
View(mtcars)
library(xtable)
sink命令将输出发送到文件
sink('somehtmlfile.html')
print(xtable(mtcars),type='html')
然后用
将事情恢复正常sink()
现在在浏览器中打开somehtmlfile.html