Pregunta

I'm trying to make several tables for a paper I'm writing using stargazer, but every table comes out saying "Table 1:" followed by my intended title. Is there a way to keep it from printing that, or at least change the table number?

Edit: Name of package is stargazer, as mentioned above. It's not an issue with a specific data frame or regression, but any stargazer table I try to create. This is the code that's giving me trouble--the title of the table is printed as "Table 1: Table 1: Share of battle deaths that occurred in intrastate conflicts (%)"

\begin{table}[htb] \centering  
  \caption{Table 1: Share of battle deaths that occurred in intrastate conflicts (\%)}  
  \label{}  
\footnotesize   

\begin{tabular}{@{\extracolsep{5pt}} c c }  
\\[-1.8ex]\hline  
\hline \\[-1.8ex]  
Years & Intrastate.conflict.battle.deaths \\  
\hline \\[-1.8ex]  
1950s & $8$ \\  
1960s & $29$ \\  
1970s & $43$ \\  
1980s & $67$ \\  
1990s & $92$ \\  
2000-2002 & $93$ \\  
\hline \\[-1.8ex]  
\normalsize  
\end{tabular}  
\end{table}

Edit edit: sorry, I'm new to this, and I realize now what you meant by the code.

stargazer(battle_deaths, title = "Table 1: Share of battle deaths that occurred in intrastate conflicts (\%)", summary = FALSE, notes = "Source: Lacina and Gleiditsch 2005")
¿Fue útil?

Solución

You know that stargazer has a title argument, right? (see page 2 of the docs: http://cran.r-project.org/web/packages/stargazer/stargazer.pdf). Minimal example:

library(ggplot2)
data(diamonds)
model <- lm(price ~ color + clarity,data=diamonds)
library(stargazer)
stargazer(model, title="Your title here")

Don't number your tables by hand. LaTeX is perfectly capable of doing that for you.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top