2014-02-12 67 views
6

有沒有辦法讓stargazer中的notes包裝行而不是跑掉頁面?Stargazer筆記線包裝?

stargazer(fit.1, 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?") 

主要生產:

\hline \\[-1.8ex] 
\textit{Notes:} & \multicolumn{2}{l}{$^{*}$P $<$ .05} \\ 
& \multicolumn{2}{l}{$^{**}$P $<$ .01} \\ 
& \multicolumn{2}{l}{$^{***}$P $<$ .001} \\ 
& \multicolumn{2}{l}{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?} \\ 
\normalsize 
\end{tabular} 
\end{table} 

我不能爲調整該發現手冊中的任何內容。

+5

快速解決方法是使用'parbox',看起來像這樣:'notes =「\\ parbox [t] {10cm} {非常長的筆記這裏。}「'但如果您調整模型,可能需要手動更改。 – Bryan

回答

9

notes參數接受一個字符串的向量,並將它們放在一個新行中。在你的例子中,以下應該工作:

stargazer(linear.1, 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?")) 
+9

如果未來版本的觀星者會按照上面Bryan的評論將這個向量的每個這樣的元素放到它自己的parbox中,那將是非常棒的。至少手動斷線似乎不夠優雅。 – RoyalTS

+4

謝謝,會考慮。 – Marek