title: for each group summarise means for all variables in dataframe (ddply? split?)
body: <p>A week ago I would have done this  manually: subset dataframe by group to new dataframes. For each dataframe compute means for each variables, then rbind. very clunky ... </p>
  
  <p>Now i have learned about <code>split</code> and <code>plyr</code>, and I guess there must be an easier way using these tools. Please don't prove me wrong.</p>
  
  <pre><code>test_data &lt;- data.frame(cbind(
  var0 = rnorm(100),
  var1 = rnorm(100,1),
  var2 = rnorm(100,2),
  var3 = rnorm(100,3),
  var4 = rnorm(100,4),
  group = sample(letters[1:10],100,replace=T),
  year = sample(c(2007,2009),100, replace=T)))
  
  test_data$var1 &lt;- as.numeric(as.character(test_data$var1))
  test_data$var2 &lt;- as.numeric(as.character(test_data$var2))
  test_data$var3 &lt;- as.numeric(as.character(test_data$var3))
  test_data$var4 &lt;- as.numeric(as.character(test_data$var4))
  </code></pre>
  
  <p>I am toying with both <code>ddply</code> but I can't produce what I desire - i.e. a table like this, for each group</p>
  
  <pre><code>group a |2007|2009|
  ________|____|____|
  var1    | xx | xx |
  var2    | xx | xx |
  etc.    | etc| ect|
  </code></pre>
  
  <p>maybe <code>d_ply</code> and some <code>odfweave</code> output would work to. Inputs are very much appreciated.</p>
  
  <p>p.s. I notice that data.frame converts the rnorm to factors in my data.frame? how can I avoid this - I(rnorm(100) doesn't work so I have to convert to numerics as done above</p>