get.Avg.Neighbor.Distance <-
function(PositionData){
dist.matrix <- as.matrix(dist(PositionData[,4:6]))
off.diag <- dist.matrix[col(dist.matrix)==row(dist.matrix)+1]
return(mean(off.diag))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.