topoSort: Combine multiple sorted vectors into a single sorted vector

View source: R/taxa.R

topoSortR Documentation

Combine multiple sorted vectors into a single sorted vector

Description

Combine multiple sorted vectors into a single vector assuming there are no cycles or weird topologies. Where a global position is ambiguous, the result is placed arbitrarily.

Usage

topoSort(vectors, maxIter = 1000, errorIfAmbiguous = FALSE)

Arguments

vectors

A list of vectors each vector containing sorted elements to be merged into a global sorted vector

maxIter

An integer specifying the maximum number of iterations before bailing out. This should be unnecessary and is just a safety feature in case of some unexpected input or bug.

errorIfAmbiguous

If TRUE then error if any ambiguities arise

Value

a vector with all unique elements sorted by the combined ordering provided by the input vectors

See Also

normalizeTaxa

Examples

topoSort(list(c('a','b','f','g'),c('b','e','g','y','z'),c('b','d','e','f','y')))

taxonomizr documentation built on Feb. 16, 2023, 6:25 p.m.