title: How to calculate z-score for each column of dataframe in R?
body: <p>I have a data set as:</p>
  
  <pre><code>&gt; mydata
    V1 V2 V3 V4
  1  1  2  3  4
  2  5  6  7  8
  3  9 10 11 12
  4 13 14 15 16
  5 17 18 19 20 
  </code></pre>
  
  <p>I want to calculate the z-score for each column of the data. I was wondering if I could create "for loops" to calculate standard deviation and mean for each column and then use the z-score formula?</p>