Learn R Programming

EcotoneFinder (version 0.2.3)

clustergram.cmeans: cmeans function for clustergram

Description

cmeans function for clustergram

Usage

clustergram.cmeans(Data, k, method = "cmeans", ...)

Arguments

Data

Should be a scales matrix. Where each column belongs to a different dimension of the observations.

k

Number of desired groups for the c-means clustering.

method

Clustering method for the cmeans function.

...

Additional parameters to be passed to the cmeans function.

Value

A list containing the cluster vector and the centers matrix (see cmeans function).

Details

This is an implementation of Fuzzy c-means clustering (with the cmeans function of the e1071 package) for the clustergram function. The return list is internally used by the clustergram to build the clustergram plot.

Examples

Run this code
# NOT RUN {
####### Example data:
   SyntheticTrial <- SyntheticData(SpeciesNum = 100,
                                   CommunityNum = 3, SpCo = NULL,
                                   Length = 500,
                                   Parameters = list(a=c(40, 80, 50),
                                                     b=c(100,250,400),
                                                     c=rep(0.03,3)),
                                   dev.c = .015, pal = c("#008585", "#FBF2C4", "#C7522B"))

   ######## 6 clustergram plots
   for (i in 1:6) clustergram(as.matrix(SyntheticTrial[,2:ncol(SyntheticTrial)]),
                              clustering.function = clustergram.cmeans,
                              k.range = 2:10, line.width = .2)
 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab