# r - Stop table disappearing off end of page with stargazer

I have a .Rnw file that looks like this:

\documentclass[a4paper,11pt]{article}
\begin{document}
\title{}
\author{me}
\date{\today}
\maketitle

<<table_mtcars, results = "asis">>=

stargazer(rbind(mtcars, mtcars, mtcars), summary = F)

@
\FloatBarrier

\end{document}


I can use knitr::knit to produce a .tex file and then convert this to a PDF. The resultant PDF looks like this:

Note how the table disappears off the end of page 2 and doesnt resurface on page 3. How can I get the table to continue on page 3 of the PDF using stargazer?

1. 2019-11-13

As far as I know this is not currently supported by stargazer. I would recommend emailing the developer, who is usually very open to suggestions. The issue is that you need to use LaTeX's longtable environment instead of tabular, but this is the part that Stargazer doesn't seem to support.

You can create a workaround by doing:

\documentclass[a4paper,11pt]{article}
\usepackage{longtable}
\begin{document}
\title{}
\author{me}
\date{\today}
\maketitle


Basically, you're calling knitr within your .Rnw file in order to build the table, and gsub the tabular environment to longtable. When I run this, it comes out as three pages long.