R/extract.r

Defines functions clusters clusters.kmeans clusters.default clusters.partition

Documented in clusters

#' Extract clusters from clustering object.
#'
#' @param x object
#' @export
#' @keywords internal
clusters <- function(x) UseMethod("clusters", x)
#' @export
clusters.kmeans <- function(x) as.vector(x$cluster)
#' @export
clusters.default <- function(x) as.vector(x)
#' @export
clusters.partition <- function(x) x$clustering

Try the clusterfly package in your browser

Any scripts or data that you put into this service are public.

clusterfly documentation built on May 2, 2019, 9:12 a.m.