clusterData: Cluster time series data.

Description Usage Arguments Value Examples

View source: R/clustering.R

Description

Perform cluster assignment using hierarchical clustering and static or dynamic branch cutting. If 'subset' is specified the clsutering is performed on the subset of the data, and the rest of the rows are assigned based on the distances to the centroids of computed clusters.

Usage

1
2
3
4
5
6
7
8
clusterData(
  X,
  dist = "euclidean",
  dynamic = FALSE,
  hclust_params = list(),
  static_cut_params = list(h = 0.5),
  dynamic_cut_params = list(max_height = 0.9)
)

Arguments

X

a data matrix or data.frame where rows are time series.

dist

the distance metric for the dissimilarity used for clustering.

dynamic

whether dynamic branch cutting should be done for cluster assignment.

hclust_params

parameters for hclust function.

static_cut_params

parameters for assignClusterStatic.

dynamic_cut_params

parameters for assignClusterDynamic.

Value

a list with the hclust object, as well as clust_map and clust_centroids data.frames.

Examples

1
2
3
4
5
6
data("endoderm_small")
endoderm_small <- normalizeData(endoderm_small)
X <- SummarizedExperiment::assays(endoderm_small)$norm
clust_res <- clusterData(X)
head(clust_res$clust_centroids)
head(clust_res$clust_map)

nlhuong/TimeSeriesExperiment documentation built on Sept. 8, 2021, 12:30 a.m.