<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/mapping-biodiversity-data-on-smaller-than-one-degree-scale/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://vijaybarve.wordpress.com/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/"> Vijay Barve</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Guest Post by Enjie (Jane) LI</p>
<p>I have been using bdvis package<a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/bdvis/index.html"> (version 0.2.9</a>) to visualize the iNaturalist records of RAScals project (<a target="_blank" rel="nofollow" href="http://www.inaturalist.org/projects/rascals)">http://www.inaturalist.org/projects/rascals)</a>.</p>
<p>Initially, the mapgrid function in the <a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/bdvis/index.html">bdvis version 0.2.9 </a>was written to map the number of records, number of species and completeness in a 1-degree cell grid (~111km x 111km resolution).</p>
<p>I applied this function to the RASCals dataset, see the following code. However, the mapping results are not satisfying. The 1 degree cells are too big to reveal the details in the study areas. Also, the raster grid was on top the basemap, which makes it really hard to associate the mapping results with physical locations.</p>
<pre>
library(rinat)
library(bdvis)

rascals=get_inat_obs_project(&quot;rascals&quot;)
conf &lt;- list(Latitude=&quot;latitude&quot;,
             Longitude=&quot;longitude&quot;,
             Date_collected=&quot;Observed.on&quot;,
             Scientific_name=&quot;Scientific.name&quot;)
rascals &lt;- format_bdvis(rascals, config=conf)
## Get rid of a record with weird location log
rascals &lt;- rascals[!(rascals$Id== 4657868),]
rascals &lt;- getcellid(rascals)
rascals &lt;- gettaxo(rascals)
bdsummary(rascals)

a &lt;- mapgrid(indf = rascals, ptype = &quot;records&quot;,
             title = &quot;distribution of RASCals records&quot;,
             bbox = NA, legscale = 0, collow = &quot;blue&quot;,
             colhigh = &quot;red&quot;, mapdatabase = &quot;county&quot;,
             region = &quot;CA&quot;, customize = NULL)

b &lt;- mapgrid(indf = rascals, ptype = &quot;species&quot;,
              title = &quot;distribution of species richness of RASCals records&quot;,
              bbox = NA, legscale = 0, collow = &quot;blue&quot;,
              colhigh = &quot;red&quot;, mapdatabase = &quot;county&quot;,
              region = &quot;CA&quot;, customize = NULL)
</pre>
<p><img sizes="(max-width: 490px) 100vw, 490px" data-image-description="" data-orig-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals01.jpeg?w=456&amp;ssl=1" data-orig-size="500,500" data-image-title="rascals01" class="wp-image-722" data-comments-opened="1" data-recalc-dims="1" data-attachment-id="722" data-permalink="https://vijaybarve.wordpress.com/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/rascals01/" alt="rascals01" data-medium-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals01.jpeg?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals01.jpeg?w=456&amp;ssl=1?w=490" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals01.jpeg?w=456&ssl=1"></p>
<p><img sizes="(max-width: 490px) 100vw, 490px" data-image-description="" data-orig-file="https://i2.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals02.jpeg?w=456&amp;ssl=1" data-orig-size="500,500" data-image-title="rascals02" data-comments-opened="1" class="wp-image-723" data-recalc-dims="1" data-attachment-id="723" data-permalink="https://vijaybarve.wordpress.com/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/rascals02/" alt="rascals02" data-medium-file="https://i2.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals02.jpeg?w=456&amp;ssl=1?w=300" data-large-file="https://i2.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals02.jpeg?w=456&amp;ssl=1?w=490" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i2.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals02.jpeg?w=456&ssl=1"></p>
<p>I contacted developers of the package regarding these two issues. They have been very responsive to resolve them. They quickly added the gridscale argument in the mapgrid function. This new argument allows the users to choose scale (0.1 or 1). The default 1-degree cell grid for mapping.</p>
<p>Here are mapping results from using the gridscale argument. <strong>Make sure you have bdvis version 0.2.14 or later.</strong></p>
<pre>
c &lt;- mapgrid(indf = rascals, ptype = &quot;records&quot;,
             title = &quot;distribution of RASCals records&quot;,
             bbox = NA, legscale = 0, collow = &quot;blue&quot;,
             colhigh = &quot;red&quot;, mapdatabase = &quot;county&quot;,
             region = &quot;CA&quot;, customize = NULL,
             gridscale = 0.1)

d &lt;- mapgrid(indf = rascals, ptype = &quot;species&quot;,
             title = &quot;distribution of species richness of RASCals records&quot;,
             bbox = NA, legscale = 0, collow = &quot;blue&quot;,
             colhigh = &quot;red&quot;, mapdatabase = &quot;county&quot;,
             region = &quot;CA&quot;, customize = NULL,
             gridscale = 0.1)
</pre>
<p><img sizes="(max-width: 490px) 100vw, 490px" data-image-description="" data-orig-file="https://i0.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals03.jpeg?w=456&amp;ssl=1" data-orig-size="500,500" data-image-title="rascals03" data-comments-opened="1" class="wp-image-724" data-recalc-dims="1" data-attachment-id="724" data-permalink="https://vijaybarve.wordpress.com/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/rascals03/" alt="rascals03" data-medium-file="https://i0.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals03.jpeg?w=456&amp;ssl=1?w=300" data-large-file="https://i0.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals03.jpeg?w=456&amp;ssl=1?w=490" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i0.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals03.jpeg?w=456&ssl=1"></p>
<p><img sizes="(max-width: 490px) 100vw, 490px" data-image-description="" data-orig-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals04.jpeg?w=456&amp;ssl=1" data-orig-size="500,500" data-image-title="rascals04" data-comments-opened="1" class="wp-image-725" data-recalc-dims="1" data-attachment-id="725" data-permalink="https://vijaybarve.wordpress.com/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/rascals04/" alt="rascals04" data-medium-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals04.jpeg?w=456&amp;ssl=1?w=300" data-large-file="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals04.jpeg?w=456&amp;ssl=1?w=490" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" src="https://i1.wp.com/vijaybarve.files.wordpress.com/2017/02/rascals04.jpeg?w=456&ssl=1"></p>
<p>We can see that the new map with a finer resolution definitely revealed more information within the range of our study area. One more thing to note is that in this version developers have adjusted the basemap to be on top of the raster layer. This has definitely made the map easier to read and reference back to the physical space.</p>
<p>Good job team! Thanks for developing and perfecting the bdvis package.</p>
<p>References</p>
<ul>
<li>RASCals: <a target="_blank" rel="nofollow" href="http://www.inaturalist.org/projects/rascals">http://www.inaturalist.org/projects/rascals</a></li>
<li>Barve, V., &amp; Otegui, J. (2016). bdvis: Biodiversity data visualizations Version: 0.2.9 Accessed from <a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/bdvis/index.html">https://cran.r-project.org/web/packages/bdvis/index.html</a></li>
<li>Barve, V., &amp; Otegui, J. (2017). bdvis: Biodiversity data visualizations Version: 0.2.14 Accessed from <a target="_blank" rel="nofollow" href="https://github.com/vijaybarve/bdvis">https://github.com/vijaybarve/bdvis</a></li>
</ul>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vijaybarve.wordpress.com/674/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/vijaybarve.wordpress.com/674/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p>
<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/2017/02/23/mapping-biodiversity-data-on-smaller-than-one-degree-scale/"> Vijay Barve</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://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="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/TNIX-BemK-c"></a></div>