title: Reorder variables in stargazer
body: <p>I got some problem when I was trying to reorder variables in stargazer. First, I defined a character vector indicating the order I want. </p>
  
  <pre><code>&gt; order
  [1] "poly(log(fall_t), 2)1"         "poly(log(fall_t), 2)2"         "poly(winter_t, 2)1"            "poly(winter_t, 2)2"           
  [5] "poly(log(spring_t), 2)1"       "poly(log(spring_t), 2)2"       "poly(log(fall_p), 2)1"         "poly(log(fall_p), 2)2"        
  [9] "poly(log(winter_p), 2)1"       "poly(log(winter_p), 2)2"       "poly(log(spring_p), 2)1"       "poly(log(spring_p), 2)2"      
  [13] "log(aot_fall)"                 "log(aot_winter)"               "log(aot_spring)"               "poly(log(aot_fall), 2)1"      
  [17] "poly(log(aot_fall), 2)2"       "log(aot_fall):log(fall_t)"     "poly(log(aot_spring), 2)1"     "poly(log(aot_spring), 2)2"    
  [21] "log(aot_spring):log(spring_t)" "poly(log(aot_winter), 2)1"     "poly(log(aot_winter), 2)2"     "log(aot_winter):winter" 
  </code></pre>
  
  <p>Then I called stargazer</p>
  
  <pre><code>stargazer(pmclimatevft, pmftsea, pmftqsea, pmftint, title = "Panel data with fixed time effect poly",
            model.names = F, model.numbers = F, object.names = F, dep.var.caption = "Yield", dep.var.labels.include = F,
            column.labels = c("Only climate variables","linear","quartic","Intersection"),
            omit = c("Year"), omit.labels = c("Time fixed effect"),
            order = order,
            dep.var.labels = "Yield", digits = 3, notes = "*Average and square temperature of Winter are not in log form due to negative values.",
            align = T, no.space = T, column.sep.width = "-10pt", omit.stat = "f")
  </code></pre>
  
  <p>Below is the LaTex code.</p>
  
  <pre><code>\begin{table}[!htbp] \centering 
    \caption{Panel data with fixed time effect poly} 
    \label{} 
  \begin{tabular}{@{\extracolsep{-10pt}}lD{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} D{.}{.}{-3} } 
  \\[-1.8ex]\hline 
  \hline \\[-1.8ex] 
   &amp; \multicolumn{4}{c}{Yield} \\ 
  \cline{2-5} 
   &amp; \multicolumn{1}{c}{Only climate variables} &amp; \multicolumn{1}{c}{linear} &amp; \multicolumn{1}{c}{quartic} &amp; \multicolumn{1}{c}{Intersection} \\ 
  \hline \\[-1.8ex] 
   poly(log(fall\_t), 2)1 &amp; -8.096^{***} &amp; -7.946^{***} &amp; -8.030^{***} &amp; -10.271 \\ 
    &amp; (1.173) &amp; (1.184) &amp; (1.187) &amp; (9.071) \\ 
    poly(log(fall\_t), 2)2 &amp; 0.443 &amp; 0.350 &amp; 0.534 &amp; 0.340 \\ 
    &amp; (0.312) &amp; (0.323) &amp; (0.329) &amp; (0.372) \\ 
    poly(winter\_t, 2)1 &amp; -7.065^{***} &amp; -6.683^{***} &amp; -6.879^{***} &amp; 1.615 \\ 
    &amp; (0.899) &amp; (0.907) &amp; (0.926) &amp; (4.048) \\ 
    poly(winter\_t, 2)2 &amp; -1.160^{***} &amp; -1.072^{***} &amp; -1.057^{***} &amp; -1.073^{***} \\ 
    &amp; (0.279) &amp; (0.280) &amp; (0.280) &amp; (0.280) \\ 
    poly(log(spring\_t), 2)1 &amp; -9.967^{***} &amp; -10.428^{***} &amp; -10.028^{***} &amp; -19.885^{**} \\ 
    &amp; (1.095) &amp; (1.106) &amp; (1.110) &amp; (8.014) \\ 
    poly(log(spring\_t), 2)2 &amp; -0.867^{***} &amp; -0.924^{***} &amp; -0.753^{***} &amp; -0.996^{***} \\ 
    &amp; (0.269) &amp; (0.274) &amp; (0.276) &amp; (0.288) \\ 
    poly(log(fall\_p), 2)1 &amp; 2.270^{***} &amp; 2.431^{***} &amp; 2.511^{***} &amp; 2.337^{***} \\ 
    &amp; (0.421) &amp; (0.428) &amp; (0.427) &amp; (0.432) \\ 
    poly(log(fall\_p), 2)2 &amp; -3.553^{***} &amp; -3.582^{***} &amp; -3.522^{***} &amp; -3.653^{***} \\ 
    &amp; (0.247) &amp; (0.249) &amp; (0.249) &amp; (0.253) \\ 
    poly(log(winter\_p), 2)1 &amp; 2.693^{***} &amp; 2.630^{***} &amp; 2.635^{***} &amp; 2.519^{***} \\ 
    &amp; (0.585) &amp; (0.587) &amp; (0.586) &amp; (0.591) \\ 
    poly(log(winter\_p), 2)2 &amp; -1.832^{***} &amp; -1.786^{***} &amp; -1.934^{***} &amp; -1.775^{***} \\ 
    &amp; (0.262) &amp; (0.262) &amp; (0.264) &amp; (0.265) \\ 
    poly(log(spring\_p), 2)1 &amp; 0.106 &amp; 0.196 &amp; 0.246 &amp; 0.207 \\ 
    &amp; (0.415) &amp; (0.416) &amp; (0.418) &amp; (0.417) \\ 
    poly(log(spring\_p), 2)2 &amp; -4.917^{***} &amp; -4.793^{***} &amp; -4.889^{***} &amp; -4.747^{***} \\ 
    &amp; (0.256) &amp; (0.259) &amp; (0.259) &amp; (0.261) \\ 
    log(aot\_fall) &amp;  &amp; 0.049 &amp;  &amp; -0.081 \\ 
    &amp;  &amp; (0.033) &amp;  &amp; (0.461) \\ 
    log(aot\_winter) &amp;  &amp; -0.048^{**} &amp;  &amp; -0.038^{*} \\ 
    &amp;  &amp; (0.020) &amp;  &amp; (0.021) \\ 
    log(aot\_spring) &amp;  &amp; 0.090^{***} &amp;  &amp; -0.294 \\ 
    &amp;  &amp; (0.032) &amp;  &amp; (0.315) \\ 
    poly(log(aot\_fall), 2)1 &amp;  &amp;  &amp; 0.372 &amp;  \\ 
    &amp;  &amp;  &amp; (0.571) &amp;  \\ 
    poly(log(aot\_fall), 2)2 &amp;  &amp;  &amp; -0.751^{**} &amp;  \\ 
    &amp;  &amp;  &amp; (0.302) &amp;  \\ 
    poly(log(aot\_winter), 2)1 &amp;  &amp;  &amp; -0.553 &amp;  \\ 
    &amp;  &amp;  &amp; (0.587) &amp;  \\ 
    poly(log(aot\_winter), 2)2 &amp;  &amp;  &amp; 1.321^{***} &amp;  \\ 
    &amp;  &amp;  &amp; (0.303) &amp;  \\ 
    poly(log(aot\_spring), 2)1 &amp;  &amp;  &amp; 0.868 &amp;  \\ 
    &amp;  &amp;  &amp; (0.618) &amp;  \\ 
    poly(log(aot\_spring), 2)2 &amp;  &amp;  &amp; -0.382 &amp;  \\ 
    &amp;  &amp;  &amp; (0.305) &amp;  \\ 
    log(aot\_fall):log(fall\_t) &amp;  &amp;  &amp;  &amp; 0.052 \\ 
    &amp;  &amp;  &amp;  &amp; (0.180) \\ 
    log(aot\_winter):winter\_t &amp;  &amp;  &amp;  &amp; -0.013^{**} \\ 
    &amp;  &amp;  &amp;  &amp; (0.006) \\ 
    log(aot\_spring):log(spring\_t) &amp;  &amp;  &amp;  &amp; 0.152 \\ 
    &amp;  &amp;  &amp;  &amp; (0.128) \\ 
   \hline \\[-1.8ex] 
  Time fixed effect &amp; \multicolumn{1}{c}{Yes} &amp; \multicolumn{1}{c}{Yes} &amp; \multicolumn{1}{c}{Yes} &amp; \multicolumn{1}{c}{Yes} \\ 
  \hline \\[-1.8ex] 
  Observations &amp; \multicolumn{1}{c}{2,979} &amp; \multicolumn{1}{c}{2,979} &amp; \multicolumn{1}{c}{2,979} &amp; \multicolumn{1}{c}{2,979} \\ 
  R$^{2}$ &amp; \multicolumn{1}{c}{0.641} &amp; \multicolumn{1}{c}{0.642} &amp; \multicolumn{1}{c}{0.645} &amp; \multicolumn{1}{c}{0.643} \\ 
  Adjusted R$^{2}$ &amp; \multicolumn{1}{c}{0.621} &amp; \multicolumn{1}{c}{0.623} &amp; \multicolumn{1}{c}{0.625} &amp; \multicolumn{1}{c}{0.623} \\ 
  \hline 
  \hline \\[-1.8ex] 
  \textit{Note:}  &amp; \multicolumn{4}{r}{$^{*}$p$&lt;$0.1; $^{**}$p$&lt;$0.05; $^{***}$p$&lt;$0.01} \\ 
   &amp; \multicolumn{4}{r}{*Average and square temperature of Winter are not in log form due to negative values.} \\ 
  \end{tabular} 
  \end{table}
  </code></pre>
  
  <p>It turned out that the order in the output did not change. My order code in stargazer did not work. I can manually change the order in TeXstudio. But it would be better if we can do that in stargazer.</p>