[Tex/LaTex] Modifying the latex code from tabular() in r so that output is not cut off and is displayed properly

rtables

I am using the r function tabular() to produce tables that I can turn into pdfs. The output looks fine, except for some of the tables I am producing. When I compile the pdfs, the table is cutoff on the page, in the sense that it should continue onto another page but there is no other page of output but the latex code is there for the rest of the table. The tables are sometimes not quite centered either.
Is there a simple option I am missing in tabular that will remedy this?
Below is the stuff I have added to the latex() output from r.
Thanks.

\documentclass{article}
\usepackage{rotating}
\begin{document}
\pagenumbering{gobble}
\begin{sidewaysfigure}
\begin{tabular}

.....

\end{tabular}
\end{sidewaysfigure}
\end{document}

Best Answer

\documentclass{article}
\usepackage{longtable,pdflscape}
\begin{document}
\begin{landscape}% starts a new page
\begin{longtable}{...}

.....

\end{longtable}
\end{landscape}

foo
\end{document}