Skip to contents

Spatial clustering of the coordinates

Usage

morie_spatial_cluster(x, k = 3L)

Arguments

x

A morie_spatial.

k

Number of clusters.

Value

Integer cluster labels (via morie_cluster on coordinates).

Examples

morie_spatial_cluster(morie_spatial(expand.grid(lon = 1:6, lat = 1:6)), k = 3)
#> Warning: input has no row names; using positional labels
#>  [1] 2 2 2 2 1 1 2 2 2 2 1 1 2 2 2 1 1 1 3 3 3 1 1 1 3 3 3 3 1 1 3 3 3 3 1 1