Learn R Programming

RclusTool (version 0.91.3)

loadClusteringSample: Clustering loading

Description

Load a clustering result from a csv file into a data.sample object.

Usage

loadClusteringSample(filename.csv, data.sample, noise.cluster = "Noise")

Arguments

filename.csv

character vector specifying the path and the name of the csv file containing the clustering result.

data.sample

matrix of raw data (point by line).

noise.cluster

character name of the cluster "Noise".

Value

The function returns a list 'clustering' containing:

label

vector of labels.

summary

data.frame containing clusters summaries (min, max, sum, average, sd).

K

number of clusters.

Details

loadClusteringSample loads a clustering result from a csv file into data.sample object

See Also

saveClustering

Examples

Run this code
# NOT RUN {
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, dir.save=tempdir())

lab <- data.frame(ID=1:nrow(dat), label=c(rep("Cluster 1",50), rep("Cluster 2",50), 
                                          rep("Cluster 3",50)))
tf2 <- tempfile()
write.table(lab, tf2, sep=",")

loadClusteringSample(tf2, x)

# }

Run the code above in your browser using DataLab