stepFlexclust {flexclust} | R Documentation |
Run Flexclust Algorithms Repeatedly
Description
Runs clustering algorithms repeatedly for different numbers of clusters and returns the minimum within cluster distance solution for each.
Usage
stepFlexclust(x, k, nrep=3, verbose=TRUE, FUN = kcca, drop=TRUE,
group=NULL, simple=FALSE, save.data=FALSE, seed=NULL,
multicore=TRUE, ...)
stepcclust(...)
## S4 method for signature 'stepFlexclust,missing'
plot(x, y,
type=c("barplot", "lines"), totaldist=NULL,
xlab=NULL, ylab=NULL, ...)
## S4 method for signature 'stepFlexclust'
getModel(object, which=1)
Arguments
x , ... |
|
k |
A vector of integers passed in turn to the |
nrep |
For each value of |
FUN |
Cluster function to use, typically |
verbose |
If |
drop |
If |
group |
An optional grouping vector for the data, see
|
simple |
Return an object of class |
save.data |
Save a copy of |
seed |
If not |
multicore |
If |
y |
Not used. |
type |
Create a barplot or lines plot. |
totaldist |
Include value for 1-cluster solution in plot? Default
is |
xlab , ylab |
Graphical parameters. |
object |
Object of class |
which |
Number of model to get. If character, interpreted as number of clusters. |
Details
stepcclust
is a simple wrapper for
stepFlexclust(...,FUN=cclust)
.
Author(s)
Friedrich Leisch
Examples
data("Nclus")
plot(Nclus)
## multicore off for CRAN checks
cl1 <- stepFlexclust(Nclus, k=2:7, FUN=cclust, multicore=FALSE)
cl1
plot(cl1)
# two ways to do the same:
getModel(cl1, 4)
cl1[[4]]
opar <- par("mfrow")
par(mfrow=c(2, 2))
for(k in 3:6){
image(getModel(cl1, as.character(k)), data=Nclus)
title(main=paste(k, "clusters"))
}
par(opar)