View source: R/sampleClustering.R
buildClusteringSample | R Documentation |
Load a clustering result from a csv file into a data.sample object.
buildClusteringSample(filename.csv, data.sample, noise.cluster = "Noise")
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". |
buildClusteringSample builds a clustering result from a csv file to be later embedded into a data.sample object
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. |
saveClustering
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)
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=",")
clustering <- buildClusteringSample(tf2, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.