在 R 中制作乳胶桌的工具 [英] Tools for making latex tables in R

查看:13
本文介绍了在 R 中制作乳胶桌的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应一般要求,一个关于在 R 中生成乳胶表的社区维基.在这篇文章中,我将概述最常用的包和博客,其中包含从不太直接的对象生成乳胶表的代码.请随时添加我遗漏的任何内容,和/或提供有关如何使用 R 生成格式良好的乳胶表的提示、提示和小技巧.

On general request, a community wiki on producing latex tables in R. In this post I'll give an overview of the most commonly used packages and blogs with code for producing latex tables from less straight-forward objects. Please feel free to add any I missed, and/or give tips, hints and little tricks on how to produce nicely formatted latex tables with R.

  • xtable :用于大多数简单对象的标准表.可以在此处找到带有示例的漂亮图库.
  • memisc :调查数据管理工具,包含一些用于(基本)回归模型估计的乳胶表的工具.
  • Hmisc 包含一个函数 latex() 创建一个包含所选对象的 tex 文件.它非常灵活,还可以输出 longtable 乳胶表.帮助文件中有很多信息 ?latex
  • miscFuncs 有一个简洁的函数 'latextable' 可以转换混合字母和数字条目的矩阵数据到 LaTeX 表中,并将它们打印到控制台,以便将它们复制并粘贴到 LaTeX 文档中.
  • texreg 包(JSS 论文) 将统计模型输出转换为 LaTeX 表.合并多个模型.可以应对大约 50 种不同的模型类型,包括网络模型和多级模型(lme 和 lme4).
  • reporttools 包(JSS 论文) 是对连续变量、分类变量和日期变量进行描述性统计的另一种选择.
  • tables 包可能是 R 中最通用的 LaTeX 表制作包描述性统计
  • stargazer 包是很好的比较统计模型总结表格
  • xtable : for standard tables of most simple objects. A nice gallery with examples can be found here.
  • memisc : tool for management of survey data, contains some tools for latex tables of (basic) regression model estimates.
  • Hmisc contains a function latex() that creates a tex file containing the object of choice. It is pretty flexible, and can also output longtable latex tables. There's a lot of info in the help file ?latex
  • miscFuncs has a neat function 'latextable' that converts matrix data with mixed alphabetic and numeric entries into a LaTeX table and prints them to the console, so they can be copied and pasted into a LaTeX document.
  • texreg package (JSS paper) converts statistical model output into LaTeX tables. Merges multiple models. Can cope with about 50 different model types, including network models and multilevel models (lme and lme4).
  • reporttools package (JSS paper) is another option for descriptive statistics on continuous, categorical and date variables.
  • tables package is perhaps the most general LaTeX table making package in R for descriptive statistics
  • stargazer package makes nice comparative statistical model summary tables
  • There is the outreg function of Paul Johnson that gives Stata-like tables in Latex for the output of regressions. This one works great.
  • As given in an earlier question, there's a code snippet to adapt the memisc package for lme4 objects.
  • Suggestion for R/LaTeX table creation package
  • Rreport/LaTeX quality output package
  • sorting a table for latex output with xtable
  • Any way to produce a LaTeX table from an lme4 mer model fit object?
  • R data.frame with stacked specified titles for latex output with xtable
  • Automating adding tables fast to latex from R, with a very flexible and interesting syntax using the formula language

推荐答案

我想补充一下brew"包.您可以编写一个带有占位符的 LaTeX 的 brew 模板文件,然后酿造"它以创建一个 .tex 文件以 include 或 input 到您的 LaTeX 中.类似的东西:

I'd like to add a mention of the "brew" package. You can write a brew template file which would be LaTeX with placeholders, and then "brew" it up to create a .tex file to include or input into your LaTeX. Something like:

egin{tabular}{l l}
A & <%= fit$A %> \
B & <%= fit$B %> \
end{tabular}

brew 语法还可以处理循环,因此您可以为数据帧的每一行创建一个表格行.

The brew syntax can also handle loops, so you can create a table row for each row of a dataframe.

这篇关于在 R 中制作乳胶桌的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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