RCbray1: Calculate RCbray-curtis

View source: R/eco_micro.R

RCbray1R Documentation

Calculate RCbray-curtis

Description

Calculate RCbray-curtis

Usage

RCbray1(
  otutab,
  reps = 9,
  threads = 1,
  classic_metric = TRUE,
  split_ties = TRUE
)

Arguments

otutab

otutab

reps

how many simulation performed?

threads

use how many threads to calculate (default:4)

classic_metric

standardizes the metric to range from -1 to 1

split_ties

adds half of the number of null observations that are equal to the observed number of shared species to the calculation- this is highly recommended

Details

Parallelized version of the Raup-Crick algorithm for "abundance" data (Stegen et al. 2013).

Value

a dist

Examples


if (requireNamespace("picante")) {
  data(otutab, package = "pcutils")
  df2tree(taxonomy) -> phylo
  b_NTI1(phylo, otutab) -> bnti_res
  RCbray1(otutab, reps = 9) -> rc_res

  data.frame(
    type = factor(c("Homo_S", "Heter_S", "Homo_D", "D_limit", "Undominated"),
      levels = c("Homo_S", "Heter_S", "Homo_D", "D_limit", "Undominated")
    ),
    number = c(
      sum(bnti_res < (-2)), sum(bnti_res > 2),
      sum((abs(bnti_res) < 2) & (abs(rc_res) < 0.95)),
      sum((abs(bnti_res) < 2) & (rc_res < (-0.95))),
      sum((abs(bnti_res) < 2) & (rc_res > 0.95))
    )
  ) -> com_pro
  pcutils::gghuan(com_pro, reorder = FALSE)
}


pctax documentation built on May 29, 2024, 10:03 a.m.