title: summarize all numeric columns of data frame by group in R
body: <p>I have a data frame that has unique groups defined by 3 character variables </p>
  
  <pre><code>catvars &lt;- c("DATE", "COUNTRY_FULL_NAME", "TENOR")
  </code></pre>
  
  <p>The rest of the data frame consists of 20 numeric variables (condensing it to 3 in the sample below)</p>
  
  <pre><code>numvars &lt;- c("X1", "Y1, "Z1")
  </code></pre>
  
  <p>I am trying to create a new data frame with the mean for each numeric variable calculates by group</p>
  
  <p>For a single variable, I can use ddply from the plyr package:</p>
  
  <pre><code>DFsum &lt;- ddply(DF, catvars, summarize, X1mean = mean(X, na.rm=TRUE))
  </code></pre>
  
  <p>But I can't figure out how to modify this ddply command to include all numeric variables. Any suggestions? Thank you</p>