set.seed(14); spatstat.data::flu |>
spatstat.geom::subset.hyperframe(subset = (stain == 'M2-M1') & (virustype == 'wt')) |>
spatstat.geom::`$.hyperframe`(name = 'pattern') |>
kmeans.ppplist(formula = ~ x + y, centers = 3L) |>
split()
# $`wt M2-M1 13.1`
# Marked planar point pattern: 153 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 13.2`
# Marked planar point pattern: 147 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 13.3`
# Marked planar point pattern: 171 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 22.1`
# Marked planar point pattern: 64 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 22.2`
# Marked planar point pattern: 85 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 22.3`
# Marked planar point pattern: 68 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 27.1`
# Marked planar point pattern: 71 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 27.2`
# Marked planar point pattern: 59 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 27.3`
# Marked planar point pattern: 84 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 43.1`
# Marked planar point pattern: 169 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 43.2`
# Marked planar point pattern: 108 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 43.3`
# Marked planar point pattern: 129 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 49.1`
# Marked planar point pattern: 125 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 49.2`
# Marked planar point pattern: 195 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 49.3`
# Marked planar point pattern: 97 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 65.1`
# Marked planar point pattern: 117 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 65.2`
# Marked planar point pattern: 109 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 65.3`
# Marked planar point pattern: 92 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 71.1`
# Marked planar point pattern: 118 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 71.2`
# Marked planar point pattern: 83 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 71.3`
# Marked planar point pattern: 64 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 84.1`
# Marked planar point pattern: 155 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 84.2`
# Marked planar point pattern: 156 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# $`wt M2-M1 84.3`
# Marked planar point pattern: 198 points
# Multitype, with levels = M2, M1
# window: rectangle = [0, 3331] x [0, 3331] nm
#
# attr(,"id")
# [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8
# attr(,"cluster")
# [1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3