title: How to calculate standard deviation of circular data
body: <p>I've followed the advice laid out here for calculating the average of circular data:</p>
  
  <p><a href="https://en.wikipedia.org/wiki/Mean_of_circular_quantities" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Mean_of_circular_quantities</a></p>
  
  <p>But I'd also like to calculate standard deviation as well. </p>
  
  <pre><code>#A vector of directional data (separated by 20 degrees each)
  Dir2&lt;-c(350,20,40)
  
  #Degrees to Radians
  D2R&lt;-0.0174532925
  
  #Radians to Degrees
  Rad2&lt;-Dir2 * D2R
  
  
  Sin2&lt;-sin(Rad2)
  SinAvg&lt;-mean(Sin2)
  
  Cos2&lt;-cos(Rad2)
  CosAvg&lt;-mean(Cos2)
  
  RADAVG&lt;-atan2(SinAvg, CosAvg)
  DirAvg&lt;-RADAVG * R2D
  </code></pre>
  
  <p>The above gives me the average, but I don't know how to calculate the SD</p>
  
  <p>I tried to just take the mean of the standard deviation for both the sine and cos, but I get varying answers. </p>
  
  <pre><code>SinSD&lt;-sd(Sin2)
  CosSD&lt;-sd(Cos2)
  mean(CosSD, SinSD)
  </code></pre>