identify_neigbours = function( nb, index, n_neighbours=1 ) {
out = index
for (k in 1:n_neighbours) {
aoi = out
for (j in aoi) {
out = sort( unique( c(aoi, nb$nbs[[j]]) ) )
}
}
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.