# with rmarkdown tufte-handout template xtables placed at the document end

I cannot understand why the chunks in rmarkdown would place tables at the end of the document. If I allow ECHO = TRUE in the chunk header, the code gets output in the correct place, but the table (which contains wrapped long lines) gets placed at the document end.

{r what_Modality, echo=FALSE, results='asis'}

colnames(df.Modality) <- c("Experience in modality")
xt.Modality <- xtable(df.Modality, caption = "What modality")
align(xt.Modality) <- c('l', 'p{3.5in}')
print(xt.Modality, table.placement="!h")




Note: it does seem that using echo=FALSE in the chunk header is important - if you display the R code, then table may skip further down the paragraph order despite !h

! - overrides any options h - means here - so that the table stays where it is declared. Further information can be found at wikibooks. Oh yes - in case one wonders about aligning the xtable object in the line before last - it is necessary to achieve long line wrapping, which I have in this one-column table displaying survey textual responses output.

• You can also use floating = FALSE in print.xtable. – alistaire Dec 9 '16 at 0:32