replace_taxon_ids: Replace taxon ids

View source: R/old_taxa--taxonomy--s3.R

replace_taxon_idsR Documentation

Replace taxon ids

Description

Replace taxon ids in a [taxmap()] or [taxonomy()] object.

obj$replace_taxon_ids(new_ids)
replace_taxon_ids(obj, new_ids)

Arguments

obj

The [taxonomy()] or [taxmap()] object.

new_ids

A vector of new ids, one per taxon. They must be unique and in the same order as the corresponding ids in 'obj$taxon_ids()'.

Value

A [taxonomy()] or [taxmap()] object with new taxon ids

Examples

# Replace taxon IDs with numbers
replace_taxon_ids(ex_taxmap, seq_len(length(ex_taxmap$taxa)))

# Make taxon IDs capital letters
replace_taxon_ids(ex_taxmap, toupper(taxon_ids(ex_taxmap)))


metacoder documentation built on April 4, 2023, 9:08 a.m.