clusterSummary: Clusters summaries computation

Description Usage Arguments Details Value Examples

View source: R/sampleClustering.R

Description

Save clusters summaries results in a csv file.

Usage

1
2
3
4
5
6
7
clusterSummary(
  data.sample,
  label,
  features.to.keep = colnames(data.sample$features[["preprocessed"]]$x),
  summary.functions = c(Min = "min", Max = "max", Sum = "sum", Average = "mean", SD =
    "sd")
)

Arguments

data.sample

list containing features, profiles and clustering results.

label

vector of labels.

features.to.keep

vector of features names on which the summaries are computed.

summary.functions

vector of functions names for the summaries computation. Could be 'Min', 'Max', 'Sum', 'Average', 'sd'.

Details

clusterSummary computes the clusters summaries (min, max, sum, average, sd) from a clustering result.

Value

out data.frame containing the clusters summaries.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)
labels <- formatLabelSample(res$cluster, x)
cluster.summary <- clusterSummary(x, labels)

RclusTool documentation built on Feb. 4, 2020, 5:08 p.m.