saveClustering: Clustering saving

View source: R/sampleClustering.R

saveClusteringR Documentation

Clustering saving

Description

Save a clustering result in a csv file.

Usage

saveClustering(filename.csv, label, dir)

Arguments

filename.csv

character vector specifying the path and the name of the csv file.

label

vector of labels.

dir

character vector specifying the directory where to save the csv file.

Details

saveClustering saves a clustering result in a csv file

Value

csv file containing clustering result.

See Also

buildClusteringSample

Examples

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())
res <- KmeansQuick(x$features$initial$x, K=3)

tf2 <- tempfile()
saveClustering(basename(tf2), res$cluster, tempdir())



RclusTool documentation built on May 29, 2024, 5:23 a.m.