简体   繁体   English

用寻星仪在Rmarkdown投影仪中绘制表格

[英]Plot a table in Rmarkdown beamer with stargazer

I am tryng to plot the summary of a regression in my beamer rmarkdown presentation. 我正在尝试在我的投影仪rmarkdown演示中绘制回归摘要。 Using the stargazer function, I do this 我使用观星功能

```{r, echo = T , comment =  "" , message=FALSE, warning=FALSE }
regra_taylor_0 <- dynlm(selic ~ lag(selic,-1) + desvio + hiato, data=data_estimacao_ts)

```

```{r, echo = F , comment =  "" , message=FALSE, warning=FALSE}

stargazer(regra_taylor_0 )


```

But the result in the presetation is like this 但是预设的结果是这样的

% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: qua, jun 20, 2018 - 14:47:05
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{1}{c}{\textit{Dependent variable:}} \\
\cline{2-2}
\\[-1.8ex] & selic \\
\hline \\[-1.8ex]
lag(selic, -1) & 0.962$^{***}$ \\
& (0.036) \\
& \\

Please help 请帮忙

Here's a minimal example that demonstrates how to get the desired stargazer output and also to remove the stargazer comment message: 这是一个最小的示例,演示了如何获取所需的观星者输出以及如何删除观星者注释消息:

---
output: pdf_document
---

```{r setup, include=FALSE}
# You can set chunk options globally so you don't have to repeat them in every chunk
knitr::opts_chunk$set(echo = TRUE, message=FALSE, warning=FALSE)

library(stargazer)
```

```{r, results='asis'}
stargazer(lm(mpg ~ wt, data=mtcars), header=FALSE)
```

If you want to change and option for a specific chunk, you can do add a chunk option
like echo=FALSE.


```{r, results='asis', echo=FALSE}
stargazer(lm(mpg ~ wt + hp + vs, data=mtcars), header=FALSE)
```

```{r, results='asis'}
# Change the font size with the font.size argument. See the help for size options
stargazer(lm(mpg ~ wt + hp + vs, data=mtcars), header=FALSE, font.size = "scriptsize")
```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM