Data Science Desktop Survival Guide
by Graham Williams |
|||||
Improvements Using BookTabs |
Raw The booktabs package for
LaTeX provides additional functionality that we can make use of
with knitr::kable(). To use this be sure to include the
following in the preamble (before the \begin{document}
of your
.Rnw file:
# Load the package from the local library into the R session.
\usepackage{booktabs}
We can then set booktabs=TRUE to remove the clutter of the extra lines.
|
# Use the booktabs option to improve presentation of the table.
ds %>% kable(row.names=FALSE, digits=0, booktabs=TRUE)
In the following example we notice that with more rows booktabs=TRUE will add a small gap every 5 rows.
|
# Display a tale with more observations.
weatherAUS[sample(nobs, 12), vars] %>% kable(row.names=FALSE, digits=0, booktabs=TRUE)
|