我在我的自动 rmarkdown pdf 文档中使用 stargazer 包来制作漂亮的表格。默认情况下,Stargazer 将其表格放置在页面的中心。如何让 stargazer 生成将表格向左对齐的乳胶代码?
这是我的意思的一个例子:
library(stargazer)
data_object <- structure(list(test = structure(c(1L, 1L, 2L, 2L), .Label = c("test1", "test2"), class = "factor"), test2 = structure(1:4, .Label = c("1", "2", "3", "4"), class = "factor")), .Names = c("test", "test2"), row.names = c(NA, -4L), class = "data.frame")
stargazer(data_object,title="table test",summary=FALSE,rownames=FALSE,type="latex",header=FALSE)
它产生的代码是:
\begin{table}[!htbp] \centering
\caption{table test}
\label{}
\begin{tabular}{@{\extracolsep{5pt}} cc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
test & test2 \\
\hline \\[-1.8ex]
test1 & 1 \\
test1 & 2 \\
test2 & 3 \\
test2 & 4 \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}
注意\centering
. 我怎样才能改变它而不必改变乳胶代码本身?