Skip to content

Commit

Permalink
more sources for downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
bomeara committed Jul 11, 2019
1 parent 1a0b978 commit 78a5d16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/dataFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ aggregate_category <- function(locations, focal='realm', group_by = "taxon", ret

#' Get all descendant species of the taxon
#'
#' Uses taxize and GBIF. Note it can only get up to 1000 names currently
#' Uses taxize, datelife, and sources of GBIF, Catalogue of Life, and OpenTree. Note it can only get up to 1000 names currently
#'
#' @param taxon Clade of interest
#' @return vector of species names
Expand All @@ -168,9 +168,9 @@ descendant_species <- function(taxon) {

try(gbif_id <- taxize::get_gbifid_(taxon)[[1]]$usagekey[1])
try(species <- taxize::downstream(gbif_id, downto = "species", db = "gbif", limit=1000)[[1]]$name)
if(length(species)==0) {
try(species <- downstream("Onthophagus", db = 'itis', downto = 'species')[[1]]$taxonname)
}
try(species <- c(species, datelife::get_ott_children(taxon)))
try(species <- c(species, taxize::downstream("Onthophagus", db = 'itis', downto = 'species')[[1]]$taxonname))
try(species <- unique(species))
return(species)
}

Expand Down
2 changes: 1 addition & 1 deletion man/descendant_species.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78a5d16

Please sign in to comment.