-
Notifications
You must be signed in to change notification settings - Fork 9
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
Classification as data frame #4
Comments
thanks for the issue @tomjwebb 😸 edited your code above just a bit so it can run without errors (namespace calls to dplyr fxns) Might make sense to add a function like this where you can input >1 taxonomic names and get classifications in a data.frame Note that this is in library(taxize)
xx <- get_wormsid(c('Platanista gangetica', 'Leucophaeus scoresbii'))
dplyr::tbl_df(cbind(classification(xx)))
# A tibble: 2 x 29
kingdom phylum subphylum superclass superclass.1 class subclass order suborder infraorder
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 Animalia Chordata Vertebrata Gnathostomata Tetrapoda Mammalia Theria Cetartiodactyla Cetancodonta Cetacea
2 Animalia Chordata Vertebrata Gnathostomata Tetrapoda Aves <NA> Charadriiformes <NA> <NA>
# ... with 19 more variables: superfamily <chr>, family <chr>, genus <chr>, species <chr>, kingdom_id <chr>,
# phylum_id <chr>, subphylum_id <chr>, superclass_id <chr>, superclass_id.1 <chr>, class_id <chr>, subclass_id <chr>,
# order_id <chr>, suborder_id <chr>, infraorder_id <chr>, superfamily_id <chr>, family_id <chr>, genus_id <chr>,
# species_id <chr>, query <chr> even though that's in thoughts? |
Ah thanks @sckott - I should have checked Anyway if you envisage others using |
thinking about this |
add some helper fxns to zzz.r and add underscore versions to children and classification with egs
@tomjwebb okay, reinstall like and look at docs for thoughts? i don't want to break current functionality of fxns in pkg, so this makes it so that new functionality will be easy to find as they are on the same man pages as their sister fxn |
@tomjwebb thoughts? |
done, we can reopen or open new issue to discuss anything further related to this |
Hi @sckott - I've been using this package and found I wanted the output of
wm_classification()
to run over a list of species and end up as a data frame - the output of this is somewhat different from what you get fromwm_record()
, in particular the classification function returns 'non-standard' taxonomic groups (superfamily etc.) which I happen to need for this application. Anyway, I've written a couple of functions, which I thought I'd upload here in case you felt there is any more general use for them? The first just turns the output fromwm_classification()
into a data frame (and attempts to do something sensible with errors), the second runs this over a list of species and then binds all the resulting data frames together into a singletbl_df
of classifications for the whole species list:The text was updated successfully, but these errors were encountered: