Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
还有其他人有这个问题吗?
> d <- data.frame(x=1:5, y=6:10) > print(d, type="html", file="d:/delete/test5.html") x y 1 1 6 2 2 7 3 3 8 4 4 9 5 5 10
我的 R 版本是 2.12.2 版本,xtable 版本是 xtable_1.5-6。
您还没有创建xtable对象,只是创建了一个数据框。print为不包括写入文件选项的数据框运行适当的方法也是如此。尝试:
xtable
print
d <- data.frame(x=1:5, y=6:10) x <- xtable(d) print(x, type="html", file="d:/delete/test5.html")
更一般地说,如果您想将内容写入文件,您可以尝试cat.
cat