Created
January 28, 2014 19:46
-
-
Save jebyrnes/8674787 to your computer and use it in GitHub Desktop.
A quick script to get the order of a species if you know it's latin binomial name using the Reol library http://cran.r-project.org/web/packages/Reol/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(Reol) | |
getOrder <- function(binom_taxa, db = "NCBI Taxonomy"){ | |
MyEOLs <- DownloadSearchedTaxa(binom_taxa, to.file=FALSE) | |
hier <- DownloadHierarchy(MyEOLs, FALSE, database=db) | |
taxonomic_info <- CombineHierarchyInfo(hier) | |
ord <- which(taxonomic_info[[2]]=="Order") | |
return(taxonomic_info[[1]][ord,1]) | |
} | |
ord1 <- getOrder("Laminaria saccharina") | |
ord2 <- getOrder("Saccharina latissima") | |
ord1 | |
ord2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment