Visualize completeness of biodiversity data
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Package bdvis: Biodiversity data visualizations using R is helpful to understand completeness of biodiversity inventory, extent of geographical, taxonomic and temporal coverage, gaps and biases in data. Package bdvis version 0.2.6 is on CRAN now. This version has several features added since version 0.1.0. I plan to post set of blog entries here to describe some of the key features of the package with some code snippets.
The function bdcomplete computes completeness values for each cell. So after dividing the extent of the dataset in cells (via the getcellid function), this function calculates the Chao2 estimator of species richness. In simple terms, the function estimates looking at the data records in each cell and how many species are represented, how complete that dataset.
The following code snippet shows how the data downloaded from Global Biodiversity Information Facility GBIF Data Portal. The .zip file downloaded using the portal has a file occurrence.txt which contains the data records. Copy that file in the working folder and try the following script.
library(bdvis) # Download GBIF data from data.gbif,org portal and # extract occurrence.txt file in Data folder occurrence <- read.delim( 'occurrence.txt', quote='', stringsAsFactors=FALSE) # Set configuration variables to format data conf <- list(Latitude='decimalLatitude', Longitude='decimalLongitude', Date_collected='eventDate', Scientific_name='specificEpithet') occurrence <- format_bdvis(occurrence, config=conf) # Compute completeness and visualize using mapgrid comp=bdcomplete(occurrence) mapgrid(comp,ptype='complete')
The completeness function produces a graph showing Completeness vs number of Species. More points in higher range of completeness indices indicates better data.
Now to visualize the data spatially, if any particular region needs better sampling the function mapgrid can now be used with ptype = “complete” parameter. This plots all the grids that have data records more than recs parameter (default = 50) using a color range from light purple to dark blue. Darker the color better the data in that cell.
References:
- Barve, V., & Otegui, J. (2016). bdvis: visualizing biodiversity data in R.Bioinformatics. 10.1093/bioinformatics/btw333 Available from
- Barve, V., & Otegui, J. (2016). bdvis: Biodiversity data visualizations Version: 0.2.6 Accessed from https://cran.r-project.org/web/packages/bdvis/index.html
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.