Skip to content
Prev 353817 / 398502 Next

Output In R

Hi Shivi,
A correction to my latex/knitr code.  I stupidly forgot the initial problem was the length of the data set.  To get it to print correctly we need to use the LaTeX package 'longtable'.  Clearly too many trees for me to see the forest.
Add \usepackage{longtable} to the Preamble.

#==========Revised code for knitr/R========
<<atable, echo=FALSE, results="asis">>=
library(xtable) 
dat1  <-  data.frame(matrix( rnorm(2000), ncol = 5))
dat1.table  <-  xtable(dat1)
print(dat1.table,tabular.environment='longtable',
floating = FALSE,
include.rownames=FALSE,
booktabs = TRUE)
@
#==============end===================

John Kane
Kingston ON Canada
https://science.nature.nps.gov/im/datamgmt/statistics/R/documents/R_for_SAS_SPSS_users.pdf
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!