Estimate the gap statistic on an ordination result
This is a wrapper for the clusGap
function,
expecting an ordination result as the main data argument.
gapstat_ord(ord, axes = c(1:2), type = "sites", FUNcluster = function(x, k) { list(cluster = pam(x, k, cluster.only = TRUE)) }, K.max = 8, ...)
ord |
(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 |
axes |
(Optional). The ordination axes that you want to include. |
type |
(Optional). One of |
FUNcluster |
(Optional). This is passed to
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 |
... |
(Optional). Additional named parameters
passed on to |
An object of S3 class "clusGap"
, basically a list with components.
See the clusGap
documentation for more details.
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")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.