Code: Select all
library(knitr)
knit("code.Rnw","code.tex")
pdflatex code.tex
Code: Select all
\documentclass[12pt,english,nohyper]{tufte-handout}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{geometry}
\usepackage{pgffor}
\usepackage{caption}
\usepackage{calc}
\usepackage{enumitem}
\usepackage{microtype}
\usepackage{tabularx} % specify width of xtable
\makeatletter
\makeatother
\newcounter{marginresume}
\begin{document}
<<include=FALSE>>=
library(ggplot2)
library(reshape2)
library(xtable)
library(dplyr)
library(stringr)
@
<<echo=FALSE,results='asis'>>=
set.seed(1)
myDF = data.frame(vals=runif(26, 1, 10))
row.names(myDF) = letters
print(xtable(myDF,caption='This is the caption to my data frame',align='lr'),floating=FALSE, tabular.environment = "longtable")
#align(x.width) <- "|X|X|X|" #Not working
@
\end{document}
However, as the column width is very small, I have a very long and narrow xtable() output.
Instead, I would like to automate the display of the xtable() output such that there are three tables produced, side-by-side. In this case, there would be 9 rows in the left-most table, 9 rows in the middle table, and 8 rows in the right-most table. It would look something like this:
Is it possible to accomplish this? This is an automated process, and so the input data frame will not always be 26 rows. Instead, the row number will vary.
Thank you for any advice!