clustergram.kmeans: Type function that clustergram takes for clustering.

Description Usage Arguments Details Value Examples

View source: R/Clustergram.R

Description

Type function that clustergram takes for clustering.

Usage

1

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 k-means clustering.

...

Additional parameters to be passed in the kmeans function (from the stats package).

Details

This is the type of function that the clustergram function uses for clustering. The return list is internally used by the clustergram to build the clustergram plot.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  ####### 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.kmeans,
                              k.range = 2:10, line.width = .2)

EcotoneFinder documentation built on Feb. 17, 2021, 1:07 a.m.