Description Usage Arguments Details Value Note Author(s) References Examples
Examines several stopping rules included in the package NbClust
and dynamicTreeCut
and produce a matrix of partitions.
1 | StoppingRules(dist, data, method = "average", rule = c("static", "dynamic", "optimal"))
|
dist |
A matrix of distances, given as a matrix, not as a |
data |
Data frame. The original data matrix, observations by variables (clusters of variables are created). |
method |
String. Method for hierarchical cluster analysis, for the moment only method "average" has been tested. |
rule |
String vector. Can include one or more of |
The rule "easystop" means that the correct number of clusters is considered, the rule "optimal" means that the number of clusters with the highest value of adjusted rand index is considered.
clusterings |
A matrix of clusterings, an element by row, a stopping rule by column |
values |
A matrix of information on each stopping rule, its value or its parameters. A row by parameter, a column by stopping rule. Most values are |
A large part of the code has been taken from package NbClust
and has been modified to fit our necessities
Giulio Costantini
Langfelder, P., Zhang, B., & Horvath, S. (2008). Defining clusters from a hierarchical cluster tree: the Dynamic Tree Cut package for R. Bioinformatics, 24(5), 719-720. Milligan, G. W., & Cooper, M. C. (1985). An examination of procedures for determining the number of clusters in a data set. Psychometri, 50(2), 159-179.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
library(TOMproject)
N <- 10
N2 <- 30
m <- 15
# define a network
net <- Topology(N=N, m=m, topology="BA", exact.m=F, force.connected=T, negpro=0, pw_ba=1, minpcor=.1, maxpcor=.3)
pcm <- net$pcm
# assign clones
assi <- Assign(N=N, N2=N2, method_assign="pwr", shape1= .0001, shape2 = 1000)
assignments <- c()
for(i in 1:length(assi)) assignments <- c(assignments, rep(i, assi[i]))
# clone the network
cloned <- Clone(pcm=pcm, assi=assi, n=1000, furthersharedvar=.5, rndvar=.5, p=.9, keeporig=TRUE)
## TOMZhang and stopping rules
library(WGCNA)
dist <- TOMdist(adjMat=cor(cloned$cloned), TOMType="signed", TOMDenom="mean")
res <- StoppingRules(dist = dist, data = cloned$cloned, method = "average")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.