title: Calculate correlation with cor(), only for numerical columns
body: <p>I have a dataframe and would like to calculate the <a href="http://stat.ethz.ch/R-manual/R-patched/library/stats/html/cor.html" rel="noreferrer">correlation</a> (with Spearman, data is categorical and ranked) but only for a subset of columns. I tried with all, but R's <a href="http://stat.ethz.ch/R-manual/R-patched/library/stats/html/cor.html" rel="noreferrer">cor</a>() function only accepts numerical data (x must be numeric, says the error message), even if Spearman is used.</p>
  
  <p>One brute approach is to delete the non-numerical columns from the dataframe. This is not as elegant, for speed I still don't want to calculate correlations between <em>all</em> columns. </p>
  
  <p>I hope there is a way to simply say "calculate correlations for columns x, y, z". Column references could by number or by name. I suppose the flexible way to provide them would be through a vector.</p>
  
  <p>Any suggestions are appreciated. </p>