title: Calculate group variance while excluding current observation
body: <p>I have a data frame (DF),
  That comprises of: grade and school id.</p>
  <p>I'm trying to create a 'Var_grade' variable that  calculates the variance of the grades of all the other rows which belong to the same school, excluding the current one.
  How could I do that in R?</p>
  <p>for example-</p>
  <p><img src="https://i.stack.imgur.com/gUel5.png" alt="A table" /></p>
  <p>I tried to run this code-</p>
  <pre><code>DF&lt;-DF %&gt;% group_by(School)%&gt;%
    mutate(Var_grade= combn(grade, (n()-1),  FUN=VAR))
  </code></pre>
  <p>but I got this error message-
  The error occured in group 1: School = 1</p>