The maximum number of clusters to consider, passed to clusGap
B
The number of bootstrap, passed to clusGap
cluster
A charater string could be either "kmeans" or "hclust" to specify the
clustering algorithm.
plot
Logical; whether return the gap statistic plot.
dist.method
Distance meaurement, passed to function "dist".
dist.diag
Passed to function "dist".
dist.upper
Passed to function "dist".
dist.p
Passed to function "dist".
hcl.method
Hierarchical clustering method, passed to "hclust"
hcl.members
Passed to "hclust"
km.iter.max
Maximum number of iteration in kmeans, passed to "kmeans".
km.nstart
An integer to specify how many random sets should be chosen. passed to "kmeans".
km.algorithm
Kmeans algorithm, passed to "kmeans".
km.trace
See function "kmeans".
Value
It returns a list consists of five components:
"Tab", "n", "B", "FUNcluster" - see clusGap
"nClust" - the estimated number of clusters using different method, see maxSE
Author(s)
Chen Meng
References
Tibshirani, R., Walther, G. and Hastie, T. (2001).
Estimating the number of data clusters via the Gap statistic.
Journal of the Royal Statistical Society B, 63, 411-423.
Maechler, M., Rousseeuw, P., Struyf, A., Hubert, M., Hornik, K.(2015).
cluster: Cluster Analysis Basics and Extensions.
R package version 2.0.1.
See Also
Function "clusGap" in "cluster" package
Function "dist", "hclust", "kmeans"
Examples
# see examples in code{link{mbpca}}
data("NCI60_4arrays")
moa <- mbpca(NCI60_4arrays, ncomp = 10, k = "all", method = "globalScore", option = "lambda1",
center=TRUE, scale=FALSE)
gap <- moGap(moa, K.max = 12, cluster = "hcl")
genes <- moaCoef(moa)
scr <- moaScore(moa)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(mogsa)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/mogsa/moGap.Rd_%03d_medium.png", width=480, height=480)
> ### Name: moGap
> ### Title: Gap statistic for clustering latent variables in 'moa-class'.
> ### Aliases: moGap
> ### Keywords: gap statistic moa
>
> ### ** Examples
>
> # see examples in code{mbpca}
>
>
> data("NCI60_4arrays")
> moa <- mbpca(NCI60_4arrays, ncomp = 10, k = "all", method = "globalScore", option = "lambda1",
+ center=TRUE, scale=FALSE)
calculating component 1 ...
calculating component 2 ...
calculating component 3 ...
calculating component 4 ...
calculating component 5 ...
calculating component 6 ...
calculating component 7 ...
calculating component 8 ...
calculating component 9 ...
calculating component 10 ...
> gap <- moGap(moa, K.max = 12, cluster = "hcl")
>
> genes <- moaCoef(moa)
> scr <- moaScore(moa)
>
>
>
>
>
>
> dev.off()
null device
1
>