如何在 R Markdown (rmarkdown) html 输出笔记中显示重要的星星?
How to show significance stars in R Markdown (rmarkdown) html output notes?
我想使用 R Markdown 在 HTML 文档中显示回归输出。我尝试了 texreg
和 stargazer
包。我现在的问题是,在笔记中我无法使重要的星星栩栩如生。由于自动生成,我似乎无法逃避它们。我一直在思考 this and this 但没有成功。我错过了什么?非常感谢!!
这是一些代码:
```{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!
```
注:问题是以前的我现在已经分了
使用 HTML 实体作为星号:
star.symbol='*'
参见http://www.ascii.cl/htmlcodes.htm。
您也可以手动添加 "legend":
stargazer(lm1, type="html", notes = "<em>*p<0.1;**p<0.05;***p<0.01</em>", notes.append = F)
我想使用 R Markdown 在 HTML 文档中显示回归输出。我尝试了 texreg
和 stargazer
包。我现在的问题是,在笔记中我无法使重要的星星栩栩如生。由于自动生成,我似乎无法逃避它们。我一直在思考 this and this 但没有成功。我错过了什么?非常感谢!!
这是一些代码:
```{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!
```
注:问题是以前的
使用 HTML 实体作为星号:
star.symbol='*'
参见http://www.ascii.cl/htmlcodes.htm。
您也可以手动添加 "legend":
stargazer(lm1, type="html", notes = "<em>*p<0.1;**p<0.05;***p<0.01</em>", notes.append = F)