merge_to_parent: Merge taxa to their respective parents

View source: R/merge_to_parent.R

merge_to_parentR Documentation

Merge taxa to their respective parents

Description

Aggregation of taxon concepts to their respective parents. All names of aggregated concepts will become synonyms in the target parent.

Usage

merge_to_parent(object, ...)

## S3 method for class 'taxlist'
merge_to_parent(object, concept_id, ...)

Arguments

object

An object of class taxlist.

...

Further arguments passed among methods.

concept_id

A vector of IDs (TaxonConceptID) of taxa that will be aggregated into their respective parents. Note that if one of the IDs is simultaneously the parent of another ID in the vector, this function will retrieve an error message.

Value

An object of class taxlist with merged taxa.

See Also

merge_taxa()

Examples

## Subset with Kyllinga species
ky <- subset(Easplist, TaxonName == "Kyllinga", keep_children = TRUE,
    keep_parents = TRUE)
ky
indented_list(ky)

## Merge two species with the genus
summary(ky, c(346, 50400))
summary(ky, "Kyllinga", exact = TRUE)
ky <- merge_to_parent(ky, c(346, 50400))

summary(ky, "Kyllinga", exact = TRUE)

kamapu/taxlist documentation built on Feb. 17, 2024, 8:27 a.m.