R-LaTeX宽桌子 [英] R-LaTeX Wide table

查看:64
本文介绍了R-LaTeX宽桌子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写报告.我必须摆一张很宽的桌子:

I'm writing a report with sweave. I have to put-in a very wide table:

来自R

dim(myData)
> 50 60

我编写的用于生成LaTex表的R代码是:

The R code I wrote to generate the LaTex table is:

print(xtable(myData, caption="my wide table", label="tab:myTab", digits=3),
       tabular.environment="longtable", caption.placement="top",
    ## floating.environment="sidewaystable", ## a trial
       size="\\tiny", table.placement="", floating=FALSE)

问题在于表格对于页面的尺寸而言太宽了,因此,有没有办法将表格划分到不同的页面中,例如LaTeX longtable环境,但是要按宽度划分?

The problem is that the table is too wide for the dimension of the page, so, is there a way to divide the table in different pages, such as LaTeX longtable environment but, by the width??

我希望我能够解释我的问题.

I hope I have been able to explain my problem.

致谢

里卡多

推荐答案

您可以通过子集数据手动创建多个表

You could create multiple tables manually by subsetting your data

表1(假设前三列应同时位于这两个列中

Table 1 (assuming first three columns should be in both

print(xtable(myData[,c(1:3,4:25)], caption="my wide table", label="tab:myTab", digits=3),
       tabular.environment="longtable", caption.placement="top",
       size="\\tiny", table.placement="", floating=FALSE)

表2

print(xtable(myData[,c(1:3,25:50)], caption="my wide table", label="tab:myTab", digits=3),
       tabular.environment="longtable", caption.placement="top",
       size="\\tiny", table.placement="", floating=FALSE)

这篇关于R-LaTeX宽桌子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆