R: table1 output

两盒软妹~` 提交于 2020-07-23 02:27:06

问题


Some days ago I found table1 library to get nice tables.

The only one problem (for me), its that output is a HTML table. I am using rtf library to export R table to word, but I dont know how export this output table (HTML) to word .

I wonder if exist some posibilty of get a different output. Or a different way to convert to R table. I am no using R-studio.

Thanks in advance.

library(table1)

table1(~mpg| carb*am,data = mtcars)

回答1:


Thanks to @r2evans for the information, I could get a R table, maybe I lost a little bit the format but is ok when I export to word with rtf library:

library(rvest)
library(table1)

tbl_1=table1(~mpg| carb*am,data = mtcars)
as.data.frame(read_html(tbl_1) %>% html_table(fill=TRUE))


来源:https://stackoverflow.com/questions/61622338/r-table1-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!