clean_tnrs: Eliminates unmatched (NAs) and invalid taxa from a...

View source: R/opentree_taxonomy_general.R

clean_tnrsR Documentation

Eliminates unmatched (NAs) and invalid taxa from a rotl::tnrs_match_names() or tnrs_match() output Useful to get ott ids to retrieve an induced synthetic Open Tree of Life. Needed because using include_suppressed = FALSE in rotl::tnrs_match_names() does not drop all invalid taxa.

Description

Eliminates unmatched (NAs) and invalid taxa from a rotl::tnrs_match_names() or tnrs_match() output Useful to get ott ids to retrieve an induced synthetic Open Tree of Life. Needed because using include_suppressed = FALSE in rotl::tnrs_match_names() does not drop all invalid taxa.

Usage

clean_tnrs(
  tnrs,
  invalid = c("barren", "extinct", "uncultured", "major_rank_conflict", "incertae",
    "unplaced", "conflict", "environmental", "not_otu"),
  remove_nonmatches = FALSE
)

Arguments

tnrs

A data frame, usually an output from datelife::tnrs_match or rotl::tnrs_match_names functions, but see details.

invalid

A character string with flags to be removed from final object.

remove_nonmatches

Boolean, whether to remove unsuccessfully matched names or not.

Details

Input can be any data frame or named list that relates taxa stored in an element named "unique" to a validity category stored in "flags".

Value

A data frame or named list (depending on the input) with valid taxa only.


datelife documentation built on July 10, 2023, 2:02 a.m.