I'm using R Sweave to output an R document into a LaTeX file through R Studio on a Windows 7. I have a very large data frame from which I have to put a sample at the begin of my document. I use xtable for all my other tables after this one, but for this one I've got the problem that with more than 30 variables (columns), I don't have the place to put it on the whole page, even on landscape, without having to break it. Because I tought impossible to use xtable (or a similar way, longtable is only usefull for the length, not the width, to my aknowledge), I used the pander code to generate a R output, which worked well, except that it isn't the perfect tabular layout I would have wanted (but that's not so dramatic). The problem is that this output spans multiple pages, and I have to put him in a floating environment to make him behave like all other tables in my work (mainly to send him at the end of his section). The goal would really to make him behave like a float, because it could be that I have to make some changes to all floats (like changing their positions) later, and I wouldn't have to ask every time how to find a solution to copy just the little adjustment I made for all the others.
For me it would be splendid to be able to use some xtable-approaching solution, but just inserting my table output onto a float-alike environment would be perfect too.
I join a small reproducible exemple:
\documentclass{book}
\usepackage{caption}
\usepackage{float}
\usepackage[english]{babel}
\usepackage{lipsum}
\begin{document}
<<packages, results=hide, echo=FALSE>>=
library(dplyr)
library(xtable)
library(knitr)
library(pander)
@
Some text before... \lipsum
<<sample_table, echo=FALSE, results=verbatim>>=
iris2 <- sample_n(iris, 32)
orange2 <- sample_n(Orange, 32)
airquality2 <- sample_n(airquality, 32)
dat <- bind_cols(mtcars, iris2, orange2, airquality2, mtcars, iris2)
a <- as.data.frame(dat) %>%
sample_n(6)
row.names(a) <- NULL
pandoc.table(a, justify="left", missing="-")
@
Some text after... \lipsum
\end{document}
As you can see, the generated table just stays where she appears, and has no floating qualities. That's what I would like to change, either by changing my output method (pander), or by inserting the chunk in some floating environment, without that it cut some part because it needs more than one page to be printed.
I hope my english isn't too bad and the same with my reproducible exemples, if you want that I edit ma question just let me know in the comment and I'll do my best.
Thank you for you help!