<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/"></div></div><div><a data-url="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/" data-counturl="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/" data-count="horizontal" data-text="Visualize completeness of biodiversity data" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://vijaybarve.wordpress.com/2016/06/10/visualize-completeness-of-biodiversity-data/"> Vijay Barve</a></strong>, and kindly contributed to <a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a target="_blank" href="https://vijaybarve.wordpress.com/tag/bdvis/">Package bdvis</a>: 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 <a target="_blank" href="https://cran.r-project.org/web/packages/bdvis/index.html">bdvis version 0.2.6 </a>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.</p>
<p>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.</p>
<p>The following code snippet shows how the data downloaded from Global Biodiversity Information Facility <a target="_blank" href="http://www.gbif.org/">GBIF Data Portal</a>. 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.</p>
<pre>
library(bdvis)

# Download GBIF data from data.gbif,org portal and
# extract occurrence.txt file in Data folder
occurrence &lt;- read.delim( 'occurrence.txt',
                         quote='', stringsAsFactors=FALSE)
# Set configuration variables to format data
conf &lt;- list(Latitude='decimalLatitude',
             Longitude='decimalLongitude',
             Date_collected='eventDate',
             Scientific_name='specificEpithet')
occurrence &lt;- format_bdvis(occurrence, config=conf)
# Compute completeness and visualize using mapgrid
comp=bdcomplete(occurrence)
mapgrid(comp,ptype='complete')
</pre>
<p>The completeness function produces a graph showing Completeness vs number of Species. More points in higher range of completeness indices indicates better data.</p>
<div data-shortcode="caption" class="wp-caption"><a target="_blank" href="https://vijaybarve.files.wordpress.com/2015/08/complenessvsspecies.png"><img height="490" alt=" Completeness vs Species" width="490" class="wp-image-410" src="https://vijaybarve.files.wordpress.com/2015/08/complenessvsspecies.png?w=490&h=490"></a>
<p class="wp-caption-text">Completeness vs Species</p>
</div>
<p>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.</p>
<div data-shortcode="caption" class="wp-caption"><a target="_blank" href="https://vijaybarve.files.wordpress.com/2016/06/comp_vis_crop.jpg"><img height="595" alt="Completeness Visualization " width="490" class="wp-image-414" src="https://vijaybarve.files.wordpress.com/2016/06/comp_vis_crop.jpg?w=490&h=595"></a>
<p class="wp-caption-text">Completeness Visualization</p>
</div>
<p><strong>References:</strong></p>
<ul>
<li>Barve, V., &amp; Otegui, J. (2016). bdvis: visualizing biodiversity data in R.<i>Bioinformatics</i>. 10.1093/bioinformatics/btw333 <a target="_blank" href="http://bioinformatics.oxfordjournals.org/content/early/2016/06/09/bioinformatics.btw333">Available from</a></li>
<li>Barve, V., &amp; Otegui, J. (2016). bdvis: Biodiversity data visualizations Version: 0.2.6 Accessed from <a target="_blank" href="https://cran.r-project.org/web/packages/bdvis/index.html">https://cran.r-project.org/web/packages/bdvis/index.html</a></li>
</ul>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vijaybarve.wordpress.com/394/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/vijaybarve.wordpress.com/394/" border="0"></a> <img height="1" alt="" width="1" src="https://pixel.wp.com/b.gif?host=vijaybarve.wordpress.com&blog=38348839&%23038;post=394&%23038;subd=vijaybarve&%23038;ref=&%23038;feed=1" border="0"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/"></div></div><div><a data-url="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/" data-counturl="http://www.r-bloggers.com/visualize-completeness-of-biodiversity-data/" data-count="vertical" data-text="Visualize completeness of biodiversity data" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://vijaybarve.wordpress.com/2016/06/10/visualize-completeness-of-biodiversity-data/"> Vijay Barve</a></strong>.</div>
<hr>
<a rel="nofollow" href="http://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="http://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="http://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="http://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="http://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="http://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="http://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="http://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="http://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="http://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="http://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="http://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="http://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="http://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="http://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="http://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="http://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="http://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="http://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/7vlmWo-hJv4"></a></div>