Learn R Programming

RclusTool (version 0.91.61)

nameClusters: Clusters renaming

Description

Assign a class name to each cluster obtained by unsupervised or semi-supervised classification, thanks to the use of a training set and the majority rule method.

Usage

nameClusters(data.sample, method, RclusTool.env = initParameters())

Value

data.sample list containing features, profiles and clustering results with updated labels names.

Arguments

data.sample

list containing features, profiles and clustering results.

method

character vector specifying the clustering method (already performed) to use.

RclusTool.env

environment in which all global parameters, raw data and results are stored.

Details

nameClusters assigns a class name to each cluster obtained by unsupervised or semi-supervised classification, thanks to the use of a training set and the majority rule method

Examples

Run this code
if (FALSE) {
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf1 <- tempfile()
write.table(dat, tf1, sep=",", dec=".")

x <- importSample(file.features=tf1)
x <- computeUnSupervised(x, K=3, method.name="K-means")

nameClusters(x, method = "K-means_preprocessed")


}

Run the code above in your browser using DataLab