centers_ca: Compute Coordinates for Cluster Centers

Description Usage Arguments Value See Also Examples

View source: R/svs.r

Description

A helper function for computing the coordinates of cluster centers (typically used in correspondence analysis).

Usage

1
centers_ca(x, clusters, freq)

Arguments

x

A numeric matrix.

clusters

A clustering of the row levels of x: either a list or the output of kmeans.

freq

An optional vector of frequency counts for the row levels of x.

Value

A matrix containing the coordinates of the cluster centers.

See Also

freq_ca.

Examples

1
2
3
4
5
6
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
   stringsAsFactors = FALSE)
sca.SndT_Fra <- fast_sca(SndT_Fra)
kcl.SndT_Fra <- kmeans(sca.SndT_Fra$pos1, centers = 7)
centers_ca(sca.SndT_Fra$pos1, clusters = kcl.SndT_Fra, freq = freq_ca(SndT_Fra[, 1]))

svs documentation built on Nov. 10, 2020, 1:09 a.m.