evaluate_k function

Evaluate k from all samples in a dataset

Evaluate k from all samples in a dataset

This function extends evaluate_sample_k() for any number of samples in a dataset.

evaluate_k( data, range = 3:10, samples_col = "Sample", abundance_col = "Abundance", with_plot = FALSE, ... )

Arguments

  • data: a data.frame with, at least, the classification, abundance and sample information for each phylogenetic unit.
  • range: The range of values of k to test, default is from 3 to 10.
  • samples_col: String with name of column with sample names.
  • abundance_col: string with name of column with abundance values. Default is "Abundance".
  • with_plot: If FALSE (default) returns a vector, but if TRUE will return a plot with the scores.
  • ...: Extra arguments.

Returns

A nested data.frame (or a plot) with three indices for each k and for each sample.

Details

The plot option (with_plot = TRUE) provides centrality metrics for all samples used.

For more details on indices calculation, please see the documentation for evaluate_sample_k(), check_DB(), check_CH() and check_avgSil().

Examples

library(dplyr) #' evaluate_k(nice_tidy) # To make simple plot evaluate_k(nice_tidy, range = 4:11, with_plot =TRUE)

See Also

evaluate_sample_k(), check_DB(), check_CH(), check_avgSil(), suggest_k()

  • Maintainer: Francisco Pascoal
  • License: GPL (>= 3)
  • Last published: 2025-04-07