Repeat headers when using xtable with longtable option

后端 未结 2 1669
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-14 01:11

Is there a way to repeat the top row / set headers when generating an xtable with a longtable option ?

For eg., if I have

tableSb <- xtable(df, captio         


        
2条回答
  •  孤街浪徒
    2021-02-14 01:50

    Looking at the code for print.xtable, the only considerations it makes when tabular.environment="longtable" are

    • Emitting a warning if you also set floating=TRUE
    • Putting the caption in the right place for a longtable (top or bottom)

    It does not emit the code specific for repeating the headers on subsequent pages. Check out latex in the Hmisc package. I know it has support for longtables as well, but I don't recall if it repeats headers correctly.

提交回复
热议问题