library(sf)
data(ralu.site, package="GeNetIt")
graph <- knn.graph(ralu.site, row.names=ralu.site$SiteName,
max.dist = 2500)
plot(st_geometry(graph))
( m <- graph.metrics(graph, ralu.site, "SiteName") )
ralu.site <- merge(ralu.site, m, by="SiteName")
# plot node betweenness
plot(st_geometry(graph), col="grey")
plot(ralu.site["betweenness"], pch=19, cex=1.25, add=TRUE)
# plot node degree
plot(st_geometry(graph), col="grey")
plot(ralu.site["degree"], pch=19, cex=1.25, add=TRUE)
Run the code above in your browser using DataLab