clusterDensity: Clusters density computation

Description Usage Arguments Details Value Examples

View source: R/sampleClustering.R

Description

Save density summaries results.

Usage

1
2
3
4
5
6
clusterDensity(
  data.sample,
  label,
  space,
  features.to.keep = colnames(data.sample$features[[space]]$x)
)

Arguments

data.sample

list containing features, profiles and clustering results.

label

vector of labels.

space

space in which is the feature to deal with.

features.to.keep

vector of features names on which the summaries are computed.

Details

clusterDensity computes the clusters density from a clustering result.

Value

out data.frame containing the density summaries.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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())
x <- computeUnSupervised(x, K=3, method.name="K-means")

label<-x[["clustering"]][["K-means_preprocessed"]][["label"]]

cluster.density <- clusterDensity(x, label, "preprocessed", features.to.keep='V1')

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