1
library(stargazer)

我正在尝试将 notes 参数与 stargazer 一起使用,但它显然不起作用。这是改编自先前堆栈溢出观星问题的代码:

stargazer(mtcars, notes=c("A very very long note that I would like to put below the table,",
                     "but currently runs off the side of the page",
                     "when I compile my document.",
                     "How do I get this to wrap into paragraph form?"))

当我编译我的文档时,注释根本没有出现。

4

1 回答 1

0

您需要将便笺的多列对齐方式(我猜默认为l)更改为p{\linewidth}. 这不是一个选项(仅限clr),但您可以执行以下操作。

  • 用来gsub代替{l}_{p{\linewidth}}
  • gsub消除with的副作用cat(, sep="\n")

以下对我有用。

cat(gsub("\\{l\\}", "{p{\\\\linewidth}}", stargazer(mtcars, notes="A very very long note that I would like to put below the table, but currently runs off the side of the page when I compile my document. How do I get this to wrap into paragraph form?")), sep="\n")
于 2014-03-26T15:57:14.637 回答