Description Usage Arguments Value Examples

This function computes the average distance of the next
nearest sample for a given set of coordinates. This method
of sampling is used by the function `rarefaction`

when building the spatial accumulation curves

1 | ```
avg_nn_dist(coords)
``` |

`coords` |
a matrix with n-dimensional coordinates |

a vector of average distances for each sequential number of accumulated nearest samples.

1 2 3 4 5 6 7 8 9 10 11 | ```
# transect spatial arragnement
transect = 1:100
avg_nn_dist(transect)
grid = expand.grid(1:10, 1:10)
avg_nn_dist(grid)
par(mfrow=c(1,2))
plot(avg_nn_dist(transect), type='o', main='transect',
xlab='# of samples', ylab='average distance')
# 2-D grid spatial arrangement
plot(avg_nn_dist(grid), type='o', main='grid',
xlab='# of samples', ylab='average distance')
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.