title: How to format describeBy table in R?
body: <p>I have this data set:</p>
  
  <pre><code>Defects.I    Defects.D       Treatment
      1           2               A
      1           3               B
  </code></pre>
  
  <p>And I'm trying to do a descriptive statistics for defects detected and isolated, grouped per treatment.
  After searching for a while I found a nice function on the <code>psych</code> library called describeBy().
  With the following code:</p>
  
  <pre><code>describeBy(myData[1:2],myData$Treatment) 
  </code></pre>
  
  <p>I got this output:</p>
  
  <pre><code>Treatment A        
                    Mean.   Median.    Trimed.
      Defects.I       x        x          x
      Defects.D       x        x          x
  
  Treatment B        
                    Mean.   Median.    Trimed.
      Defects.I       x        x          x
      Defects.D       x        x          x
  </code></pre>
  
  <p>But in reality I was looking for something like</p>
  
  <pre><code>                  Mean.   Median.    Trimed.
                    A  B     A  B       A  B
      Defects.I     x  x     x  x       x  x 
      Defects.D     x  x     x  x       x  x
  </code></pre>
  
  <p>Data</p>
  
  <pre><code>myData &lt;- structure(list(Defects.I = c(1L, 1L), Defects.D = 2:3, Treatment = c("A", 
  "B")), .Names = c("Defects.I", "Defects.D", "Treatment"), class = "data.frame", row.names = c(NA, 
  -2L))
  </code></pre>