powered by
SKATER forms clusters by spatially partitioning data that has similar values for features of interest.
spdep_skater(sfj, k = 6, nb = NULL, ini = 5, ...)
A numeric vector of clusters.
An sf object of observation data. Please ensure that the attribute columns are included in the SKATER analysis.
sf
(optional) The number of clusters. Default is 6.
6
(optional) A neighbours list with class nb. If the input nb is NULL, it will be constructed automatically using spdep_nb().
nb
spdep_nb()
(optional) The initial node in the minimal spanning tree. Defaul is 5.
5
(optional) Other parameters passed to spdep::skater().
gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) gzma_c = spdep_skater(gzma,8) gzma$group = gzma_c plot(gzma["group"])
Run the code above in your browser using DataLab