Skip to content

Commit

Permalink
taxonTree: fix issue when sole terminal node is lowest level (no chil…
Browse files Browse the repository at this point in the history
…dren) #43
  • Loading branch information
brownag committed Mar 23, 2023
1 parent 46d688d commit aed9abf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/taxonTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ taxonTree <- function(taxon,
# get child taxa at most detailed `level`
lh <- level_hierarchy(family = FALSE)
lowest_level <- max(match(level, lh))
x <- unique(do.call('c', getChildTaxa(taxon,
level = as.character(lh[lowest_level]))))
x <- unique(c(taxon, do.call('c',
getChildTaxa(taxon, level = as.character(lh[lowest_level]))
)))
y <- getTaxonAtLevel(x, level = level)

# we build the tree from the terminal/leaf node information
Expand Down

0 comments on commit aed9abf

Please sign in to comment.