stargazer
automatically centres values within tables. How can I left align the columns?
Put this code in an .Rnw file and use knitr to convert to .tex:
<<load, echo=FALSE, warning=FALSE, message=FALSE>>=
opts_chunk$set(eval=TRUE, echo=FALSE, warning=FALSE, message=FALSE, dpi=300)
@
\documentclass[a4paper,11pt]{article}
\usepackage{lipsum} % Required to insert dummy text
\begin{document}
\title{}
\author{}
\date{\today}
\maketitle
\section{Header}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<<iris, results = "asis">>=
library(stargazer)
stargazer(iris[1:10,4:5], summary = FALSE)
@
\end{document}
This is the PDF output:
ccc
string in\begin{tabular}
and change it tolcc
. – Roman Luštrikstargazer
? You might have much more options to fine-tune the LaTeX table with e.g.xtable
. – daroczig