我已经使用 xtable 包很长时间了,并期待着用 R 编写我的第一个包......所以我认为,如果我有一些值得实现的“酷”想法,那就是很有可能有人在我之前到达那里...=)
我对专门用于 LaTeX 表创建的函数/包感兴趣(当然是通过 R)。我遇到了具有 latex.table
功能的 quantreg
包。对于类似的功能/包有什么建议吗?
聚苯乙烯
我正在考虑构建一个网络应用程序,用户可以在其中定义自己的表格预设/模板、选择样式、统计数据等。不过,这是一个早期的想法... =)
I've been using xtable
package for a long time, and looking forward to writting my first package in R... so I reckon that if I have some "cool" idea that's worth carying out, there's a great chance that somebody got there before me... =)
I'm interested in functions/packages specialized for LaTeX table creation (through R, of course). I bumped on quantreg
package which has latex.table
function. Any suggestion for similar function(s)/package(s)?
P.S.
I'm thinking about building a webapp in which users can define their own presets/templates of tables, choose style, statistics, etc. It's an early thought, though... =)
发布评论
评论(4)
有时我将创建 LaTeX 表格的任务分为两部分:
R导出部分涉及几个步骤:
从包括任何标题的整个表格的矩阵开始:
booktabs
LaTeX 包。write
函数导出生成的字符向量然后使用 LaTeX 中的
input
命令导入导出的文本文件。我确保文件名与表标签相对应。我在撰写期刊文章时使用了这种方法。
在这些情况下,存在许多不同类型的表格(例如,多页表格、横向表格、需要扩展边距的表格、需要特定对齐的表格、我想要更改表格标题措辞的表格)。在这种设置中,我主要发现从 R 导出数据更容易。通过这种方式,结果是可重复的研究,但更容易调整 LaTeX 文档中表格设计的各个方面。在期刊文章中,通常没有太多的表格和相当具体的格式要求。
但是,我想如果我要生成大量批量报告,我会考虑直接从 R 导出更多方面。
I sometimes divide the task of creating LaTeX tables into two parts:
The R export part involves several steps:
Starting with a matrix of the whole table including any headings:
booktabs
LaTeX package.write
functionThe exported text file is then imported using the
input
command in LaTeX. I ensure that the file name corresponds to the table label.I have used this approach in the context of writing journal articles.
In these cases, there are a lot of different types of tables (e.g., multi-page tables, landscape tables, tables requiring extended margins, tables requiring particular alignment, tables where I want to change the wording of the table title). In this setting, I've mostly found it easier to just export the data from R. In this way, the result is reproducible research, but it is easier to tweak aspects of table design in the LaTeX document. And in the context of journal articles, there are usually not too many tables and rather specific formatting requirements.
However, I imagine if I were producing large numbers of batch reports, I'd consider exporting more aspects directly from R.
超越 xtable 和 Hmisc 如 Rob 所列,至少还有
这只是基于快速搜索。因此,在尝试将其连接到网络应用程序之前,您可能还需要了解更多内容。祝你好运。
Beyond xtable and Hmisc as listed by Rob, there are also at least
This was just based on a quick search. So there may be more for you to look at before you try to hook it into a webapp. Good luck.
除了上面提到的包之外,还有 stargazer 包。它适用于许多常用函数和包(lm、glm、svyglm、plm、survival、AER、pscl 等)中的对象以及 zelig 对象。
In addition to the packages mentioned above, there is the stargazer package. It works well with objects from many commonly used functions and packages (lm, glm, svyglm, plm, survival, AER, pscl, and others), as well as with zelig objects.
除了
xtable
之外,latex 函数“nofollow noreferrer">Hmisc 包。Apart from
xtable
, there's thelatex
function in the Hmisc package.