Skip to contents

Get k-means cluster assignments from a fast cluster result

Usage

get_kmeans_clusters(x)

# S3 method for class 'SingleCellFastClusters'
get_kmeans_clusters(x)

Arguments

x

SingleCellFastClusters object.

Examples

# the centroid each cell was assigned to
sc <- demo_single_cells()
res <- fast_cluster_sc(
  sc,
  resolutions = 1.0,
  fc_params = params_sc_fast_cluster(n_centroids = 30L),
  return_kmeans = TRUE,
  .verbose = FALSE
)
head(get_kmeans_clusters(res))
#> [1] 23 13 27  5 12  1

unlink(sc@dir_data, recursive = TRUE, force = TRUE)