check_tax_uniqueness: Check taxonomy uniqueness.

View source: R/check_tax_uniqueness.R

check_tax_uniquenessR Documentation

Check taxonomy uniqueness.

Description

This function checks for the duplicate taxonomy names that can occur in different groups (e.g., the same genus names in different families).

Usage

check_tax_uniqueness(x, col = "k", return_all = F, dropNA = T)

Arguments

x

Data frame with taxonomy (columns = taxonomy ranks, rows = species)

col

Column name (taxonomy rank) that should be checked for uniqueness

return_all

Logical; default, FALSE - only non-unique values will be returned

dropNA

Logical; default, TRUE - missing values within the selected column ('col') will be removed

Value

Data frame with counts of taxon occurence (by default, only non-unique values will be shown).

Examples

datt <- data.frame(
  Kingdom = rep(LETTERS[1:2], each = 6),
  Phylum = rep(LETTERS[3:6], each = 3),
  Class = rep(letters[1:6], times = 2),
  stringsAsFactors = F
  )

check_tax_uniqueness(datt, col = "Phylum") # All ranks of Phylum are unique
check_tax_uniqueness(datt, col = "Class")  # Classes are duplicated


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.