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

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

问题描述

在一般要求下,一个有关在R中生成乳胶表的社区Wiki.在本文中,我将概述最常用的软件包和博客,其中包含用于从不太直接的对象中生成乳胶表的代码.请随时添加我错过的任何内容,和/或提供有关如何使用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 :用于大多数简单对象的标准表.可以在此处找到精美的示例画廊. /li>
  • memisc :用于管理调查数据的工具,包含(基本)回归模型估计值的乳胶表的一些工具.
  • Hmisc 包含一个函数latex(),该函数创建一个包含所选对象的tex文件.它非常灵活,还可以输出longtable乳胶表.帮助文件?latex
  • 中有很多信息
  • miscFuncs 具有一个可转换的整洁函数'latextable'将具有字母和数字混合条目的矩阵数据输入到LaTeX表中,并将其打印到控制台,以便可以将它们复制并粘贴到LaTeX文档中.
  • texreg 软件包( reporttools 软件包(包可能是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模板文件,然后对其进行"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:

\begin{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天全站免登陆