【问题标题】:xtable left justxtable 只剩下
【发布时间】:2012-09-18 04:17:02
【问题描述】:

xtable 的默认值为\begin{center}。我也想做:\begin{left}\end{left}

代码:

library(xtable)
xtable(anova(lm(mpg~hp, data=mtcars)))

期望的结果:

\begin{table}[ht]
\begin{left}
\begin{tabular}{lrrrrr}
  \hline
 & Df & Sum Sq & Mean Sq & F value & Pr($>$F) \\ 
  \hline
hp & 1 & 678.37 & 678.37 & 45.46 & 0.0000 \\ 
  Residuals & 30 & 447.67 & 14.92 &  &  \\ 
   \hline
\end{tabular}
\end{left}
\end{table}

【问题讨论】:

    标签: r xtable


    【解决方案1】:
    print(xtable(anova(lm(mpg~hp, data=mtcars))) , booktabs=TRUE, caption.placement = "top",
        latex.environments = "left")
    

    所以latex.environments = "left" 是解决方案。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多