我正在使用 RStudio IDE (v 0.99.323)rmarkdown
并尝试通过knitr
using生成模型表htmlreg
来生成 MSWord 输出。怀疑我错过了一些简单的事情。
下面附加的 rmarkdown 块创建了一个单独的单词文件 'mytable.doc' 和一个漂亮的表格。但是,当我在 RStudio IDE 中单击“Knit Word”时,htmlreg(m) 行会在 MSWord 文档中生成 html 表格代码。我究竟做错了什么?
非常感谢!——戴尔
```{r, results='asis'}
library(MASS)
library(texreg)
data(menarche)
m <- glm(cbind(Menarche, Total-Menarche) ~ Age, family=binomial(logit), data=menarche)
htmlreg(m, file = "mytable.doc", caption="Age at Menarche", inline.css = TRUE, doctype = TRUE, html.tag = TRUE, head.tag = TRUE, body.tag = TRUE, ci.force=TRUE, ci.test=NULL,bold=TRUE)
htmlreg(m)
```