title: How to get LaTeX table from latex() in Hmisc to align columns
body: <p>I have some problems getting the align to work in my latex table, here's an example:</p>
  
  <pre><code>library(Hmisc)
  set.seed(1)
  x &lt;- matrix(round(runif(6*3)*10, 2), ncol=6)
  x[1, 2] &lt;- -round(x[1, 2], 0)
  x[3, 3] &lt;- -round(x[1, 2], 1)
  x[3, 5] &lt;- round(x[1, 2], 1)
  
  ci1 &lt;- apply(x[,2:3], 1, FUN=function(x){
          ret &lt;- paste(min(x), "-", max(x))
          return(ret)
  })
  ci2 &lt;- apply(x[,5:6], 1, FUN=function(x){
          ret &lt;- paste(min(x), "-", max(x))
          return(ret)
  })
  
  x &lt;- cbind(x[,1], ci1, x[,4], ci2)
  colnames(x) &lt;- c("A", "interval", "B", "interval")
  rownames(x) &lt;- sapply(letters[1:3], FUN=function(x){ return(paste("Var_", x, sep=""))})
  
  latex(x, file="", align="rcrc", rowlabel.just="r", 
        cgroup = c("First", "Second"), 
        n.cgroup = c(2, 2),
        rgroup=c("Grup A and B", "Group C"), 
        n.rgroup=c(2, NROW(x) - 2), 
        ctable=T)
  </code></pre>
  
  <p>This produces:</p>
  
  <pre><code>% latex.default(x, file = "", align = "rcrc", rowlabel.just = "r",      cgroup = c("First", "Second"), n.cgroup = c(2, 2), rgroup = c("Grup A and B",          "Group C"), n.rgroup = c(2, NROW(x) - 2), ctable = T) 
  %
  \ctable[ label=x, pos=!tbp, ]{rllcll} {} {\FL\multicolumn{1}{c}{\bfseries x}&amp;
  \multicolumn{2}{c}{\bfseries First}&amp;
  \multicolumn{1}{c}{\bfseries }&amp;
  \multicolumn{2}{c}{\bfseries Second}
  \NN \cline{2-3} \cline{5-6}
  \multicolumn{1}{r}{}&amp;\multicolumn{1}{c}{A}&amp;\multicolumn{1}{c}{interval}&amp;\multicolumn{1}{c}{}&amp;\multicolumn{1}{c}{B}&amp;\multicolumn{1}{c}{interval}\NN
  \ML
  {\bfseries Grup A and B}&amp;&amp;&amp;&amp;&amp;\NN
  Var_a&amp;2.66&amp;-9 - 9.45&amp;&amp;0.62&amp;4.98 - 6.87\NN
  Var_b&amp;3.72&amp;2.02 - 6.61&amp;&amp;2.06&amp;3.84 - 7.18\NN
  \ML
  {\bfseries Group C}&amp;&amp;&amp;&amp;&amp;\NN
  Var_c&amp;5.73&amp;8.98 - 9&amp;&amp;1.77&amp;-9 - 9.92\NN
  \LL
  }
  </code></pre>
  
  <p>The error is here: </p>
  
  <pre><code>\ctable[ label=x, pos=!tbp, ]{rllcll}
  </code></pre>
  
  <p>I want <strong>rllcll</strong> to be <strong>rrccrc</strong> but it doesn't do that. I have tried all possible alternatives for the aling and halign parameter. It's a little annoying to be doing this by hand...</p>