title: Same process in different data frames with R
body: <p>I want to know if is possible to do the same process en different data frames in R, for example:
  I had 5 different data frames and I want to do in each one the next process:</p>
  <ol>
  <li>Converting a column as a row names</li>
  </ol>
  <blockquote>
  <p>rownames(x1) &lt;- x1$Var1</p>
  </blockquote>
  <ol start="2">
  <li>Transposing de data frame</li>
  </ol>
  <blockquote>
  <p>x1.t &lt;- as.data.frame(t(as.matrix(x1)))</p>
  </blockquote>
  <ol start="3">
  <li>Calculating a correlation:</li>
  </ol>
  <blockquote>
  <p>x1.corr &lt;- cor(x1.t, method = &quot;spearman&quot;)</p>
  </blockquote>
  <p>I don't want to have a lot of code, and I think it could be done with functions and loops, but I'm not sure how exactly.</p>
  <p>Thanks very much, any advice or material will be appreciated.</p>