traitecoevo / taxonlookup

A versioned and dynamically updating taxonomic lookup table for land plants
http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12517/abstract
Other
31 stars 6 forks source link

Code for manipulating taxonomic hierarchy #1

Closed richfitz closed 9 years ago

richfitz commented 9 years ago

Suppose you have a genus/family/order/table and you want to apply that to a vector of species. Or you have binomial/genus/family/order table and you want to add a new species and have all the columns fill in.

Basically some way of working nicely with these sorts of data.

richfitz commented 9 years ago

Also, "is.nested" - are the given taxonomic levels perfectly nested?

wcornwell commented 9 years ago
get_family<-function(binomial){
  genus<-taxonlookup:::split_genus(binomial)
  return(plant_lookup()$family[match(genus,plant_lookup()$genus)])
}

isn't that the most common use case?

wcornwell commented 9 years ago

closing for now since lookup_table does the most common task, but will re-open is there is a specific function we should add