在 Knitr 中调整观星表的大小 [英] Resizing a stargazer table in Knitr

查看:23
本文介绍了在 Knitr 中调整观星表的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 knitr 整理了一份文档,虽然大部分文档看起来都不错,但有一个回归表太宽,无法在不做任何改动的情况下放在页面上.

I've put together a document using knitr and while most of the document looks fine, there's one regression table that's too wide to fit on a page without some alteration.

回归表是使用 stargazer 生成的,非常宽.

The regression table is generated using stargazer, and is quite wide.

我已尝试按如下方式调整整个块的大小:

I've attempted to resize the entire chunk as follows:

{r, echo=FALSE, resize.width=10, results='asis'}

stargazer( table...)

但在生成调整大小的输出方面没有运气.是不是我做错了什么,不能通过块选项调整这些观星表的大小吗?

but have had no luck in generating resized output. Is there something that I'm doing wrong, is it not possible to resize these stargazer tables via chunk options?

谢谢!

推荐答案

您可以操纵 stargazer 的选项来调整 stargazer 表的大小.对于 R markdown 的 PDF 输出,请尝试以下操作:

You can manipulate the options of stargazer to resize your stargazer table. Try the following for PDF output of R markdown:

stargazer(model_1, model_2, model_3, model_4, model_5,
          type = 'latex',
 
          header=FALSE, # to get rid of r package output text

          single.row = TRUE, # to put coefficients and standard errors on same line

          no.space = TRUE, # to remove the spaces after each line of coefficients

          column.sep.width = "3pt", # to reduce column width

          font.size = "small" # to make font size smaller

)

这篇关于在 Knitr 中调整观星表的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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