Table placement with stargazer and knitr

爱⌒轻易说出口 提交于 2019-12-04 07:39:42

Starting with version 4.0 (available on CRAN now), you can easily adjust the table placement by using the table.placement argument.

One way of going about this is by replacing the placement argument using regular expressions.

If you check the stargazer output, you will notice that the default is

[4] "\\begin{table}[htb] \\centering " 

You can find htb and replace it with your argument. Here's one way

x <- stargazer(model1)
gsub("\\[htb\\]", "[h]", x)
 [4] "\\begin{table}[h] \\centering " 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!