title: Calculating the mean, standard error and % in R for a data frame
body: <p>I have a data frame with following structure, <code>dput(scoreDF)</code>:</p>
  
  <pre><code>scoreDF &lt;- structure(list(ID = c(1, 2), Status = structure(c(2L, 1L),
    .Label = c("Fail", "Pass"), class = "factor"), Subject_1_Score = c(100, 25),
    Subject_2_Score = c(50, 76)), .Names = c("ID", "Status", "Subject_1_Score",
    "Subject_2_Score"), row.names = c(NA, -2L), class = "data.frame")
  </code></pre>
  
  <p>Now, I need to come up with the % of students who passed and failed, mean of the students who passed and failed, standard error for the same.</p>
  
  <p>For standard error, I have defined a function as follows:</p>
  
  <pre><code>stdErr &lt;- function(x) {sd(x)/ sqrt(length(x))}
  </code></pre>
  
  <p>where I expect <code>x</code> to be a vector whose standard error needs to be calculated.</p>
  
  <p>I have seen the doc for <code>ddply</code>, but I am not able to figure out how to calculate the % i.e. (number of passes)/ (total count) and standard error for the data frame above.</p>