R/internal_filter_rank.R

Defines functions filter_rank

Documented in filter_rank

#' Function to download species from fishtreeoflife
#'
#' @param order Character with names of species
#'
#' @return phylogeny
#'
#' @keywords internal
#' 
filter_rank<- function(order){
  if(length(which(sub("_.*", "", unlist(order)) == "not.found")) >= 1){
    
    phy_ord<- fishtree::fishtree_phylogeny(unlist(order)[-which(sub("_.*", "", unlist(order)) == "not.found")])
    
  } else{
    phy_ord<- fishtree::fishtree_phylogeny(unlist(order))
  }
  phy_ord
}

Try the FishPhyloMaker package in your browser

Any scripts or data that you put into this service are public.

FishPhyloMaker documentation built on Sept. 15, 2021, 9:09 a.m.