1

Following the instructions for using the stargazer package, I should get the following table with the command:

stargazer(attitude)

image However, when typing the code in the RStudio console, I get only:

> stargazer(attitude)

% Table created by stargazer v.5.2.2 by Marek Hlavac, Harvard University. E-mail: hlavac at fas.harvard.edu
% Date and time: sáb, mar 30, 2019 - 12:40:26
\begin{table}[!htbp] \centering 
  \caption{} 
  \label{} 
\begin{tabular}{@{\extracolsep{5pt}}lccccccc} 
\\[-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}{Pctl(25)} & \multicolumn{1}{c}{Pctl(75)} & \multicolumn{1}{c}{Max} \\ 
\hline \\[-1.8ex] 
rating & 30 & 64.633 & 12.173 & 40 & 58.8 & 71.8 & 85 \\ 
complaints & 30 & 66.600 & 13.315 & 37 & 58.5 & 77 & 90 \\ 
privileges & 30 & 53.133 & 12.235 & 30 & 45 & 62.5 & 83 \\ 
learning & 30 & 56.367 & 11.737 & 34 & 47 & 66.8 & 75 \\ 
raises & 30 & 64.633 & 10.397 & 43 & 58.2 & 71 & 88 \\ 
critical & 30 & 74.767 & 9.895 & 49 & 69.2 & 80 & 92 \\ 
advance & 30 & 42.933 & 10.289 & 25 & 35 & 47.8 & 72 \\ 
\hline \\[-1.8ex] 
\end{tabular} 
\end{table} 

But I can not see the table in the viewer. The same goes for the knitr package. What am I doing wrong?

Hector Haffenden
  • 1,360
  • 10
  • 25
  • You want to knit the Rmd (with stargazer table) into a pdf? – pogibas Mar 30 '19 at 16:44
  • I would like to see the table in the rstudio viewer, but I am also not succeeding with RMD. I do not know what to do to get my table! – Victor Sartor Mar 30 '19 at 16:46
  • Check this post https://stackoverflow.com/questions/14670299/using-stargazer-with-rstudio-and-knitr – pogibas Mar 30 '19 at 16:47
  • Maybe I was not clear enough in my question. Should not RStudio give me the latex table as output in the viewer? Or should I get the generated code on the console and compile it with MikTex, for example? – Victor Sartor Mar 30 '19 at 17:41
  • I doubt that it does, but check the most upvoted answer, it shows how to knit it – pogibas Mar 31 '19 at 06:27

0 Answers0