jay*_*.sf 5 r r-markdown stargazer texreg
我想使用 R Markdown 在 HTML 文档中显示回归输出。我尝试了texreg和stargazer包。我现在的问题是,在笔记中我无法将重要的星星带入生活。由于自动生成,我似乎无法摆脱它们。我一直对这个和这个感到困惑,但没有成功。我错过了什么?非常感谢!!
这是一些代码:
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r data}
library(car)
lm1 <- lm(prestige ~ income + education, data=Duncan)
```
## with STARGAZER
```{r table1, results = "asis", message=FALSE}
library(stargazer)
stargazer(lm1, type="html", notes="stargazer html 1") # nothing
stargazer(lm1, type="html", notes="stargazer html 2", star.char = "\\*") # nothing, even gone in table
```
## with TEXREG
```{r table2, results = "asis", message=FALSE}
library(texreg)
htmlreg(lm1, custom.note="%stars. htmlreg") # nothing
htmlreg(lm1, custom.note="%stars. htmlreg", star.symbol = "\\*") # still nothing!
```
Run Code Online (Sandbox Code Playgroud)
注意:问题是我现在拆分的以前的子问题。
使用星号的 HTML 实体:
star.symbol='*'
Run Code Online (Sandbox Code Playgroud)
请参阅http://www.ascii.cl/htmlcodes.htm。
您还可以手动添加“图例”:
stargazer(lm1, type="html", notes = "<em>*p<0.1;**p<0.05;***p<0.01</em>", notes.append = F)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2475 次 |
| 最近记录: |