I am trying to use knitr and stargazer to export a regression table from R to Latex. Unfortunately I get the following error message "Missing $ inserted" I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed.
Do I miss anything in my code or might this be an error from the stargazer package?
Any hints on how one can use knitr and stargazer together?
\documentclass{article}
\begin{document}
%Load dataset and run regression
<< lm, echo=FALSE >>=
load('dataset.RData')
library(stargazer)
lm1 <- lm(y~ x ,data=dataset)
@
<< table_texstyle, echo=FALSE, comment=NA, results='asis' >>=
stargazer(lm1)
@
\end{document}
xtable
if you can't get that working. – scottyaz