runKmeans: runKmeans

Description Usage Arguments Value See Also Examples

View source: R/cluster.R

Description

Perform k-means clustering on a data matrix.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
runKmeans(
  object,
  k = 25,
  iter.max = 10,
  nstart = 1,
  algorithm = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"),
  trace = FALSE,
  scale = FALSE,
  verbose = FALSE,
  ...
)

Arguments

object

a CYT object

k

numeric. The number of clusters.

iter.max

numeric. The maximum number of iterations allowed.

nstart

numeric. If k is a number, how many random sets should be chosen.

algorithm

character. Type of algorithm that will be choosen to calculate kmeans. Four algoritms are provided: Hartigan-Wong, Lloyd, Forgy, MacQueen.

trace

logical or integer number.

scale

logical. Whether to use scaled data in kmeans.

verbose

logical. Whether to print calculation progress.

...

Parameters passing to kmeans function

Value

a CYT object with kmeans.id in meta.data

See Also

kmeans

Examples

1
2
3
4
cyt.file <- system.file("extdata/cyt.rds", package = "CytoTree")
cyt <- readRDS(file = cyt.file)

cyt <- runKmeans(cyt, k = 25, verbose = TRUE)

CytoTree documentation built on Nov. 10, 2020, 2 a.m.