knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE )
Summarise and visualize data sets taxonomically
The proposed workflow with taxview
:
remotes::install_github("ropensci/taxview")
library(taxview)
get some data
x <- system.file("examples/plant_spp.csv", package = "taxview")
prepare data: clean, etc.
dat <- tibble::as_tibble( data.table::fread(x, stringsAsFactors = FALSE, data.table = FALSE)) out <- tv_prep_ids(x, ids = dat$id, db = "ncbi")
Prepare summary. The output of tv_summarise()
is an S3 class, with a summary of the groupings.
res <- tv_summarise(out) res
The $summary
slot has the number of taxa in the dataset
res$summary
The $by_rank
slot has the breakdown of taxa within each rank category, as a count and percentage.
res$by_rank
The $by_rank_name
slot has the breakdown of taxa ...
res$by_rank_name
The $by_within_rank
slot has the breakdown of number of records within each taxon within each rank grouping.
res$by_within_rank[1:2]
visualize (NOT WORKING YET)
tv_viz(res)
taxview
in R doing citation(package = 'taxview')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.