#mean direction
circ_mean <- function(theta){
r.theta <- theta*pi/180
u <- mean(cos(r.theta))
v <- mean(sin(r.theta))
c_mu <- atan2(v,u)
c_mu <- replace(c_mu, which(c_mu<0), c_mu[which(0 > c_mu)]+2*pi)*(180/pi)
return(c_mu)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.