I\'d like to print nicely-formatted data frames to paper, ideally from within a script. (I am trying to collect data using an instrument and automatically process and print
The grid.table solution will indeed be the quickest way to create PDF, but this may not be the optimal solution if you have a fairly long table. RStudio + knitr + longtable make it quite easy to create nicely formatted PDFs. What you'll need is something like:
\documentclass{article}
\usepackage{longtable}
\begin{document}
<>=
library(xtable)
df = data.frame(matrix(rnorm(400), nrow=100))
xt = xtable(df)
print(xt,
tabular.environment = "longtable",
floating = FALSE
)
@
\end{document}
Pls see this post for more details.