[英]Output for stargazer in R
I follow the instruction of this article 我按照本文的指示
> library(stargazer)
> stargazer(attitude)
% Table created by stargazer v.5.0 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: Fri, Mar 07, 2014 - 4:12:55 PM
\begin{table}[!htbp] \centering
\caption{}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
Statistic & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Mean} & \multicolumn{1}{c}{St. Dev.} & \multicolumn{1}{c}{Min} & \multicolumn{1}{c}{Max} \\
rating & 30 & 64.633 & 12.173 & 40 & 85 \\
complaints & 30 & 66.600 & 13.315 & 37 & 90 \\
privileges & 30 & 53.133 & 12.235 & 30 & 83 \\
learning & 30 & 56.367 & 11.737 & 34 & 75 \\
raises & 30 & 64.633 & 10.397 & 43 & 88 \\
critical & 30 & 74.767 & 9.895 & 49 & 92 \\
advance & 30 & 42.933 & 10.289 & 25 & 72 \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}
>
I cannot see the output table in R windows. 我在R窗口中看不到输出表。 Where I can access the table?
我在哪里可以访问桌子?
Check the help file for ? Stargazer
检查帮助文件中的内容
? Stargazer
? Stargazer
. ? Stargazer
。 If you want to view the table in the R environment and have it be plainly readable use the type="text"
argument. 如果要在 R环境中查看表并使其具有可读性,请使用
type="text"
参数。
My guess is that isn't the desire and you'd like to make use of the pretty table in a document. 我的猜测是,这不是期望,您想使用文档中的漂亮表格。 The
type="latex" is what you want if your creating a
sweave document and
type="html"` works nicely for markdown documents. type="latex" is what you want if your creating a
sweave document and
type =“ html”`可以很好地用于降价文档, type="latex" is what you want if your creating a
。
The simplest thing to do is install the RStudio application and the knitr package, then create a new sweave
or markdown
document. 最简单的操作是安装RStudio应用程序和knitr软件包,然后创建一个新的
sweave
或markdown
文档。 If you choose sweave
you'll also need a Latex distribution installed to render the document. 如果选择
sweave
,则还需要安装Latex发行版以呈现文档。
The easiest route is RStudio -> New Markdown File -> paste this into the file: 最简单的方法是RStudio-> New Markdown File->将此粘贴到文件中:
```{r, results='asis'}
require(stargazer)
stargazer(attitude, type="html")
```
The click the 'Knit HTML' button and look at your table. 点击“编织HTML”按钮,然后查看您的表格。
Enjoy! 请享用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.