(Required). An ordination object. The precise class can vary.
Any ordination classes supported internally by the phyloseq package
should work, ultimately by passing to the scores function
or its internal extensions in phyloseq.
axes
(Optional). The ordination axes that you want to include.
type
(Optional). One of "sites"
(the vegan package label for samples) or
"species" (the vegan package label for OTUs/taxa).
Default is "sites".
FUNcluster
(Optional). This is passed to clusGap.
The documentation is copied here for convenience:
a function which accepts as first argument a (data) matrix like x,
second argument, say (the number of desired clusters) k, where k >= 2,
and returns a list with a component named (or shortened to) cluster
which is a vector of length n = nrow(x) of integers in 1:k
determining the clustering or grouping of the n observations.
The default value is the following function, which wraps
partitioning around medoids, pam:
Any function that has these input/output properties (performing a clustering)
will suffice. The more appropriate the clustering method, the better chance
your gap statistic results will be useful.
K.max
(Optional). A single positive integer value.
It indicates the maximum number of clusters that will be considered.
Value must be at least two.
This is passed to clusGap.
...
(Optional). Additional named parameters
passed on to clusGap.
For example, the method argument provides for extensive options
regarding the method by which the “optimal” number of clusters
is computed from the gap statistics (and their standard deviations).
See the clusGap documentation for more details.
Value
An object of S3 class "clusGap", basically a list with components.
See the clusGap documentation for more details.
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(phyloseq)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/phyloseq/gapstat_ord.Rd_%03d_medium.png", width=480, height=480)
> ### Name: gapstat_ord
> ### Title: Estimate the gap statistic on an ordination result
> ### Aliases: gapstat_ord
>
> ### ** Examples
>
> data("soilrep")
> sord = ordinate(soilrep, "PCoA", "bray")
> # Evaluate axes with scree plot
> plot_scree(sord)
> # Gap Statistic
> gs = gapstat_ord(sord, axes=1:3, verbose=FALSE)
> # plot_ordination(soilrep, sord, color="Treatment")
> plot_clusgap(gs)
> print(gs, method="Tibs2001SEmax")
Clustering Gap statistic ["clusGap"].
B=100 simulated reference sets, k = 1..8
--> Number of clusters (method 'Tibs2001SEmax', SE.factor=1): 4
logW E.logW gap SE.sim
[1,] 1.5309839979 1.5419429 0.01095886 0.03736151
[2,] 1.0512110718 1.3441050 0.29289397 0.04303133
[3,] 0.7567324412 1.1827306 0.42599817 0.04508782
[4,] 0.5084174108 1.0465449 0.53812746 0.04188155
[5,] 0.3673725343 0.9304566 0.56308410 0.03990521
[6,] 0.2392728909 0.8287774 0.58950446 0.03844123
[7,] 0.1128837473 0.7368654 0.62398170 0.03876233
[8,] -0.0002522798 0.6539420 0.65419424 0.03814555
>
>
>
>
>
> dev.off()
null device
1
>