Save your stargazer results to an object:
res <- stargazer(my.lm, float=FALSE)
If you take a look at the contents of res
then you'll see it's just a series of lines of text. Write this to a file using cat()
like this
cat(res, file="tab_results.tex", sep="\n")
The sep="\n"
is only required because the lines of text in the res object dont contain any line breaks themselves. If we leave use the default sep=" "
then your table will be written to the tex file as one long line.
Hope this helps.