Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the taxonomic classification of the fish species? #126

Closed
tjquimpo opened this issue Jul 12, 2017 · 10 comments
Closed

How do I get the taxonomic classification of the fish species? #126

tjquimpo opened this issue Jul 12, 2017 · 10 comments
Milestone

Comments

@tjquimpo
Copy link

Hello,

I loaded my targeted species using the species_list and species functions. However, I could not find a function that extracted the higher taxonomic classifications (e.g. orders, class, etc.). I read in Boettiger et al. (2012) that you can use the fish_names function; but, in the current version of rfishbase, this function is no longer available. Are there any similar function(s) wherein I can load the other taxonomic units? Many thanks.

Respectfully,
Tim

@cboettig
Copy link
Member

Check out all the columns of the data frame returned rfishbase::load_taxa(), that should have all the taxonomic ranks (according to FishBase taxonomy, which may differ from other authorities), for all species in FishBase.

Apologies, the 2012 publication is now quite out of date relative to the current version of the package.

HTH,

Carl

sckott added a commit that referenced this issue Jul 12, 2017
@sckott
Copy link
Contributor

sckott commented Jul 12, 2017

also added a taxonomy() fxn - reinstall to get it - thoughts on it @cboettig ? keep or get rid of? changes?

@sckott
Copy link
Contributor

sckott commented Jul 12, 2017

see also #92

@cboettig
Copy link
Member

Nice, thanks @sckott. Can you add an example of this in the readme.rmd too?

@sckott
Copy link
Contributor

sckott commented Jul 12, 2017

sure thing

@sckott
Copy link
Contributor

sckott commented Jul 12, 2017

One thing about the /taxonomy route is that we set it up so that it only accepts the query parameters genus and species - so we can't do the thing of passing in a species list like in other fxns

so users have to do lapply or so, like

spp <- list(c("Oreochromis", "amphimelas"), c("Oreochromis", "mweruensis"))
Map(function(x) taxonomy(x[1], x[2]), spp)

is that acceptable? or too cumbersome?

@sckott
Copy link
Contributor

sckott commented Jul 12, 2017

i guess one option is to do allow passing in a list of genus+epithet names, and internally break names into genus, species, and map over each name

sckott added a commit that referenced this issue Jul 12, 2017
make it so that one of genus or species, or both are required
added taxonomy() eg to readme
@cboettig
Copy link
Member

Good questions. Yeah, obviously a consistent query interface would be nice, though I suppose if necessary that could be done merely on the R level, so the R user could pass the same species_list.

Having a way to return the full taxonomy table, a la load_taxa() is probably helpful though, since I think a common use case for the taxonomy table is actually to start with a larger group, e.g. Family, and get a list of all species in that family for later use in the other functions.

@cboettig cboettig modified the milestone: 2.2.0 Jul 12, 2017
@nbfernan
Copy link

Hi @cboettig , I am coming across this issue and had a similar question myself to the original post/question. Has this been solved in the later versions of rfishbase (3.0)? I can pull the whole data.frame of taxonomic descriptions through load_taxa(), but it would be helpful if there was an option to pass the species_list through and only obtain what is needed in terms of higher level taxonomic descriptions. Any insight would be appreciated!

@cboettig
Copy link
Member

library(rfishbase)
library(dplyr)
rfishbase::load_taxa() %>% 
  filter(Species %in% c(Oreochromis mweruensis",  "Oreochromis amphimelas")) %>%
 collect()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants