<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by biodiversityDS. on Medium]]></title>
        <description><![CDATA[Stories by biodiversityDS. on Medium]]></description>
        <link>https://medium.com/@jorgemfa?source=rss-1cc35d3d8e18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d9-ggoEgRckYgW1qAOzqzg.jpeg</url>
            <title>Stories by biodiversityDS. on Medium</title>
            <link>https://medium.com/@jorgemfa?source=rss-1cc35d3d8e18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:49:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jorgemfa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From RStudio to Remarkable: transform your R development with VS Code]]></title>
            <link>https://jorgemfa.medium.com/from-rstudio-to-remarkable-transform-your-r-development-with-vs-code-87c6dcc5add6?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/87c6dcc5add6</guid>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 11:24:22 GMT</pubDate>
            <atom:updated>2024-07-24T10:12:21.102Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m a data scientist working on unraveling the patterns and drivers of global marine biodiversity. I recently switched from RStudio to Visual Studio Code (VS Code) for R development to enhance my coding experience in two major aspects:</p><p><strong>Cross-Language Support: </strong>VS Code’s ability to support multiple programming languages out of the box, including R, Python, JavaScript, and more, allows developers to work on multi-technology projects seamlessly. This feature is particularly beneficial for me, as I work with different languages and frameworks, reducing the need to switch between tools.</p><p><strong>GitHub Copilot Integration: </strong>The integration with GitHub Copilot transforms coding in VS Code by providing AI-powered code completions. This feature accelerates my development processe, helps in reducing coding errors, and encourages the exploration of new coding solutions through intelligent, context-aware suggestions.</p><p>This guide will walk you through setting up VS Code for an enhanced R programming experience. I’ll cover the installation of necessary extensions, integration of radian as an R console, inclusion of essential packages, and configuration of global properties for optimal R development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ss-yJUGo_v2u5LKdsbtbcA.gif" /><figcaption>R development with VS Code.</figcaption></figure><p><strong>Step 1: Installing the R Extension</strong></p><p>First and foremost, to start using R in VS Code, you need to install the R extension. This extension provides rich support for the R language, including features like syntax highlighting, code formatting, and more. Here’s how to install it:</p><p>1.1. Open VS Code.</p><p>1.2. Navigate to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X (Cmd+Shift+X on the Mac).</p><p>1.3. Search for “R” in the extensions marketplace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*zbZ47BHVZhR8L1F8VCOwkg.png" /></figure><p>4. Find the R extension by Yuki Ueda or REditorSupport (identified by its logo and author name) and click Install.</p><p><strong>Step 2: Integrating Radian</strong></p><p>Radian is an alternative console for R with features like syntax highlighting and auto-completion. To integrate radian with VS Code, ensure R and Python are installed on your system and install radian by running in your terminal the following command.</p><p>2.1. Install radian.</p><pre>pip3 install radian</pre><p>Configure VS Code to use radian by setting the path to the radian executable in your<strong> </strong>settings.json. On a Mac, this is typically /usr/local/bin/radian. You can <strong>access settings.json</strong> by pressing Cmd+Shift+P on Mac or Ctrl+Shift+P on Windows/Linux, typing “Open Settings (JSON)”, and pressing Enter.</p><p>2.2. Copy the following code into settings.json.</p><pre>{<br>&quot;r.rterm.mac&quot;: &quot;/usr/local/bin/radian&quot;<br>}</pre><p><strong>Step 3: Installing Essential Packages</strong></p><p>For an enhanced development experience, install the languageserver, httpgd, and lintr packages in R. These packages provide language support, graphics display capabilities, and linting for R scripts, respectively.</p><p>3.1. Install them by running the following commands in your R console.</p><pre>install.packages(&quot;languageserver&quot;)<br>install.packages(&quot;httpgd&quot;)<br>install.packages(&quot;lintr&quot;)</pre><p><strong>Step 4: Configuring Linters and Global Properties</strong></p><p>An integral part of setting up VS Code for R development is fine-tuning the behavior of the lintr package, which plays a crucial role in maintaining high code quality and adherence to coding standards. By customizing the .lintr configuration, developers can control which linting rules are enforced, tailoring the development environment to their preferences or project-specific guidelines.</p><p>Enhance your R programming experience in VS Code by tweaking some settings in your settings.json file. You can <strong>access settings.json</strong> by pressing Cmd+Shift+P on Mac or Ctrl+Shift+P on Windows/Linux, typing “Open Settings (JSON)”, and pressing Enter.</p><p>4.1. Add the following configurations to optimize R script editing, plotting, and formatting:</p><pre>{<br>&quot;r.bracketedPaste&quot;: true,<br>&quot;r.removeLeadingComments&quot;: true,<br>&quot;r.plot.useHttpgd&quot;: true,<br>&quot;editor.wordWrap&quot;: &quot;wordWrapColumn&quot;,<br><br>&quot;[r]&quot;: {<br>   &quot;editor.defaultFormatter&quot;: &quot;REditorSupport.r&quot;<br>},<br><br>&quot;workbench.colorCustomizations&quot;: {<br>   //  &quot;editorError.foreground&quot;: &quot;#00000000&quot;, // Red Squiggly, I suggest not to change this one…<br>   //  &quot;editorWarning.foreground&quot;: &quot;#00000000&quot;, // Yellow Squiggly, I suggest not to change this one…<br>   &quot;editorInfo.foreground&quot;: &quot;#00000000&quot;, // Blue Squiggly, you could even change it yo something almost completely transparent so it doesn’t bother you as much…<br>    }<br><br>}</pre><p>These settings enable bracketed paste for more efficient console use, remove leading comments when executing code, utilize httpgd for plotting, and set the default formatters for R, ensuring your code is always neat and readable.</p><p><strong>Conclusion</strong></p><p>Migrating from RStudio to VS Code for R development not only opens up new possibilities for enhancing your development environment but also requires some adjustments to tailor the experience to your preferences.</p><p>By following the above steps, you’ve now equipped VS Code with powerful tools and configurations to supercharge your R programming. With the R extension, radian, essential packages, and tailored settings, you’re all set to enjoy a streamlined, productive coding experience in R. Whether you’re analyzing data, creating visualizations, or developing statistical models, VS Code is now a formidable ally in your R programming endeavors. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87c6dcc5add6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Producing a global map of Sea Surface Oxygen in R]]></title>
            <link>https://jorgemfa.medium.com/producing-an-equal-area-map-of-sea-surface-oxygen-in-r-4c9c10985e8e?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c9c10985e8e</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[oxygen]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[mapping]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Mon, 13 Dec 2021 14:30:46 GMT</pubDate>
            <atom:updated>2021-12-21T12:29:10.782Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUbvKUr7SPD3Ris2qEMfyw.png" /></figure><p>Plotting spatial data is a common task in research, but this requires a set of technical / design tools, which sometimes are not available to all. Here I provide a step-by-step guide to help producing an equal area map of sea surface oxygen in R.</p><p>The code provided can be used to map additional spatial information in the same raster format. The adopted Robinson projection finds a good compromise to the problem of readily showing the whole globe as a flat image.</p><p># 1. The first think is to get a shapefile defining global landmasses and a raster file with oxygen conditions. These are available at:</p><p>https://github.com/jorgeassis/dataVisualization/tree/master/Projects/seaSurfaceOxygen/Data</p><p># 2. Then set the working directory in R and load the packages.</p><pre>setwd(&quot;Projects/seaSurfaceOxygen&quot;)</pre><pre>library(ggplot2)<br>library(raster)<br>library(rnaturalearth)<br>library(sf)<br>library(geosphere)<br>library(rgeos)</pre><p># 3. Choose the projection and load the spatial data.</p><p>The <strong>Robinson projection</strong> is a <a href="https://en.wikipedia.org/wiki/Map_projection">projection</a> of the world that attempts to find a good compromise of showing the whole globe as a flat image.</p><pre>projection &lt;- CRS(&quot;+proj=robin +over&quot;)</pre><pre>oxygenLayer &lt;- raster(&quot;Data/DissolvedMolecularOxygen.tif&quot;)<br>worldMap &lt;- shapefile(&quot;Data/LandMass Polygon.shp&quot;)</pre><p># 4. Generate a bounding box and clip spatial data.</p><pre>bb &lt;- sf::st_union(sf::st_make_grid(<br>  st_bbox(c(xmin = -180,<br>            xmax = 180,<br>            ymax = 90,<br>            ymin = -90), crs = st_crs(4326)), n = 100))<br>bb &lt;- st_transform(bb, projection)</pre><pre>oxygenLayer &lt;- projectRaster(oxygenLayer, crs = projection)<br>oxygenLayer &lt;- mask(oxygenLayer, as(bb, &quot;Spatial&quot;))<br>oxygenLayer &lt;- as.data.frame(oxygenLayer,xy=TRUE,na.rm=T)<br>colnames(oxygenLayer) &lt;- c(&quot;Lon&quot;,&quot;Lat&quot;,&quot;Val&quot;)</pre><pre>worldMap &lt;- spTransform(worldMap, CRSobj = projection)<br>worldMap &lt;- gBuffer(worldMap, byid=TRUE, width=0.001)<br>worldMap &lt;- crop(worldMap, as(bb, &quot;Spatial&quot;))</pre><p># 5. Define the theme for the final plot.</p><pre>theme_map &lt;- <br>  theme(<br>    text = element_text(family = &quot;Helvetica&quot;, color = &quot;#22211d&quot;),<br>    axis.text.x = element_blank(),<br>    axis.text.y = element_blank(),<br>    axis.ticks = element_blank(),<br>    axis.title.x = element_blank(),<br>    axis.title.y = element_blank(),<br>    panel.grid.major = element_line(color = &quot;black&quot;, size = 0.1),<br>    panel.grid.minor = element_blank(),<br>    plot.background = element_rect(fill = &quot;#FFFFFF&quot;, color = NA),<br>    panel.background = element_rect(fill = &quot;#FFFFFF&quot;, color = NA),<br>    panel.border = element_blank(),<br>    legend.background = element_rect(fill = &quot;#FFFFFF&quot;, color = NA),<br>    legend.position=&quot;bottom&quot;, <br>    legend.box = &quot;horizontal&quot;,<br>    legend.margin=margin(0,0,0,0),<br>    legend.box.margin=margin(-10,-10,-10,-10),<br>    legend.key.height= unit(0.25, &#39;cm&#39;),<br>    legend.key.width= unit(0.75, &#39;cm&#39;) )</pre><p># 6. Define a color ramp for the oxygen gradient and plot the map.</p><pre>myColors &lt;- c(&quot;#6FBBE8&quot;,&quot;#A1ECD8&quot;,&quot;#F6F9AB&quot;,&quot;#FCB46D&quot;,&quot;#B21414&quot;,&quot;#D278E4&quot;,&quot;#9914B3&quot;)</pre><pre>plot &lt;- ggplot() +<br>  geom_tile(data = oxygenLayer, aes(x=Lon,y=Lat,fill=Val)) +<br>  scale_fill_gradientn(guide = guide_legend(title=&quot;Sea surface dissolved oxygen [mmol.m3]&quot;, direction = &quot;horizontal&quot;, title.position = &quot;top&quot;, title.hjust = 0.5), colours=myColors, na.value=&#39;transparent&#39;) +<br>  geom_polygon(data = worldMap, aes(x = long, y = lat, group = group), fill=&quot;#A1A1A1&quot;, colour = &quot;#A1A1A1&quot; , size=0.25 ) +<br>  geom_sf(data = bb,fill=NA, colour = &quot;white&quot; , linetype=&#39;solid&#39;, size=2 ) +<br>  theme_map<br>plot</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c9c10985e8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ocean’s Missing Highways: A Threat to Biodiversity]]></title>
            <link>https://medium.com/sea-change/the-european-network-of-marine-reserves-is-weak-in-protecting-biodiversity-981355b018b0?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/981355b018b0</guid>
            <category><![CDATA[oceans]]></category>
            <category><![CDATA[conservation]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[fisheries]]></category>
            <category><![CDATA[biodiversity]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Tue, 16 Mar 2021 22:35:18 GMT</pubDate>
            <atom:updated>2024-05-09T09:32:40.618Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HE6nOtCwvZe5diL8lM37CA.jpeg" /><figcaption>© OCEANA / Juan Cuetos</figcaption></figure><p><strong>Are Our Ocean Reserves Too Lonely?</strong></p><p>Think of <a href="https://www.iucn.org/theme/marine-and-polar/our-work/marine-protected-areas">Marine Protected Areas</a> (MPAs) as special ocean neighborhoods where fish, corals, and other sea life get a break. They’re off-limits to fishing and such, helping boost populations and keep things healthy. Lately, the idea is to link these MPAs into networks for even better results.</p><p>But here’s the thing: how well connected ARE these MPAs? A <a href="https://www.sciencedirect.com/science/article/abs/pii/S0048969721007324">fnew study</a> looked at Europe’s network and the news isn’t great. Turns out, it’s less of a network and more of a bunch of isolated islands when it comes to how ocean critters can actually move between them.</p><p><strong>Why This is a Big Deal</strong></p><p>No Backup Plan: If a heatwave or something wipes out a key species inside a single MPA, there’s nowhere for new ones to easily swim in from. That’s bad news.<br>Climate Change Equals Moving Targets: Ocean life is already shifting where it lives due to warming waters. If our protected areas aren’t well-connected, species on the move could be out of luck.<br>It’s Not Just About Fish: It’s also about corals, sponges, the whole underwater ecosystem! Isolation makes everyone more vulnerable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9eVCx3Zg9uJQegBaFmRR_A.jpeg" /><figcaption>© OCEANA / Carlos Minguell</figcaption></figure><p><strong>What Can Be Done?</strong></p><p>The study says we need to play connect-the-dots in the ocean. More MPAs strategically placed can act like stepping stones, creating safe travel routes for marine life. It’s the underwater version of those wildlife corridors you see on land! This all shows that protecting the ocean isn’t just about saying “no” to fishing in spots. It’s about a smart, long-term plan that helps nature itself stay resilient.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=981355b018b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sea-change/the-european-network-of-marine-reserves-is-weak-in-protecting-biodiversity-981355b018b0">The Ocean’s Missing Highways: A Threat to Biodiversity</a> was originally published in <a href="https://medium.com/sea-change">Sea change</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mapping Arctic sea ice extent in R]]></title>
            <link>https://jorgemfa.medium.com/mapping-arctic-sea-ice-extent-in-r-14c3366b6e13?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/14c3366b6e13</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[arctic]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Sat, 06 Feb 2021 10:22:08 GMT</pubDate>
            <atom:updated>2021-02-06T10:23:18.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nt65jLLSlxDzlJ7_" /></figure><p>Sea ice generates as seawater freezes, and because it is less dense than sea water, it floats throughout the surface of the ocean. Sea ice covers approximately 12% of the world’s oceans, and much of it is enclosed within the polar ice packs: the Arctic ice pack (Arctic Ocean) and the Antarctic ice pack (Southern Ocean). Polar ice packs experience significant yearly cycling linked to annual seasons, a natural process upon dependes global marine ecosystems. According to ongoing measurements, both summer ice thickness and extent are in a dramatic decline.</p><p>Here are a few lines of R code to produce a map of the Arctic sea ice extent. The code uses information extracted from Bio-ORACLE, an open source dataset of GIS layers that provides geophysical, biotic and environmental data for surface and benthic marine realms. The R package sdmpredictors facilitates data extraction from Bio-ORACLE, as well as smooth integration with the available pipelines for bioclimatic modelling.</p><p><a href="https://medium.com/themarinedatascientist/easy-to-use-marine-climate-layers-for-ecological-modelling-83950cd7a75f">Easy to use marine climate layers for ecological modelling</a></p><pre>## -------------------------------<br>## Prepare data</pre><pre># Load libraries and dependences<br>library(sdmpredictors)<br>library(ggplot2)<br>library(rnaturalearth)<br>library(raster)<br>library(sf)<br>library(stars)</pre><pre>## Define the extent of the map<br>cExtent &lt;- c(-180,180,45,90)</pre><pre>## Load sea ice thickness raster data<br>iceMapMin &lt;- load_layers(&quot;BO21_icethickltmin_ss&quot;)<br>iceMapMax &lt;- load_layers(&quot;BO21_icethickltmax_ss&quot;)</pre><pre>## Load a polygon defining landmasses<br>worldMap &lt;- ne_countries(scale = 10, returnclass = &quot;sp&quot;)</pre><pre>## Transform sea ice thickness in a binomial surface depicting presence / absence of sea ice <br>iceMapMin[iceMapMin &gt; 0] &lt;- 1 ; iceMapMin[iceMapMin == 0] &lt;- NA<br>iceMapMax[iceMapMax &gt; 0] &lt;- 1 ; iceMapMax[iceMapMax == 0] &lt;- NA</pre><pre>## Transform sea ice data raster to polygon data<br>iceMapMin &lt;- as_Spatial(st_as_sf(st_as_stars(iceMapMin), as_points = FALSE, merge = TRUE) )<br>iceMapMax &lt;- as_Spatial(st_as_sf(st_as_stars(iceMapMax), as_points = FALSE, merge = TRUE) )</pre><pre>## Crop ice data to the final exent<br>iceMapMin &lt;- crop(gBuffer(iceMapMin, byid=TRUE, width=0),cExtent)<br>iceMapMax &lt;- crop(gBuffer(iceMapMax, byid=TRUE, width=0),cExtent)</pre><pre>## Crop landmasses to the final exent<br>worldMap &lt;- crop(worldMap,cExtent)<br>worldMap &lt;- aggregate(worldMap,dissolve=T)<br>worldMap &lt;- gSimplify(worldMap, tol = 0.05, topologyPreserve = TRUE)</pre><pre>## -------------------------------<br>## polar map</pre><pre>x_lines &lt;- seq(-120,180, by = 60)</pre><pre>iceMap &lt;- ggplot() +<br>  <br>  geom_polygon(data = iceMapMax, aes(x = long, y = lat, group = group), fill=&quot;#BCD9EC&quot;, colour = NA) +<br>  geom_path(data = iceMapMax, aes(x = long, y = lat, group = group), color = &quot;#BCD9EC&quot;, size = 0.1) +<br>  <br>  geom_polygon(data = iceMapMin, aes( x = long, y = lat, group = group), fill=&quot;#89B2C7&quot;, colour = NA) + #89B2C7<br>  geom_path(data = iceMapMin, aes(x = long, y = lat, group = group), color = &quot;#89B2C7&quot;, size = 0.1) +<br>  <br>  geom_polygon(data = worldMap, aes(x = long, y = lat, group = group), fill=&quot;#E0DAD5&quot;, colour = NA) +<br>  <br>  theme(legend.position = &quot;none&quot;) +<br>  theme(text = element_text(family = &quot;Helvetica&quot;, color = &quot;#22211d&quot;)) +<br>  theme(panel.background = element_blank(), axis.ticks=element_blank()) +<br>  <br>  coord_map(&quot;ortho&quot;, orientation = c(90, 0, 0)) +<br>  scale_y_continuous(breaks = seq(45, 90, by = 5), labels = NULL) +<br>  <br>  scale_x_continuous(breaks = NULL) + xlab(&quot;&quot;) +  ylab(&quot;&quot;) +<br>  <br>  # Adds labels<br>  geom_text(size=3.5 , aes(x = 180, y = seq(53.3, 83.3, by = 15), hjust = -0.3, label = paste0(seq(55, 85, by = 15), &quot;°N&quot;))) +<br>  geom_text(size=3.5 , aes(x = x_lines, y = (41 + c(-3,-3,0,-3,-3,0)), label = c(&quot;120°W&quot;, &quot;60°W&quot;, &quot;0°&quot;, &quot;60°E&quot;, &quot;120°E&quot;, &quot;180°W&quot;))) +<br>  <br>  # Adds axes<br>  geom_hline(aes(yintercept = 45), size = 0.5, colour = &quot;gray&quot;)  +<br>  geom_segment(size = 0.1,aes(y = 45, yend = 90, x = x_lines, xend = x_lines), linetype = &quot;dashed&quot;) +<br>  <br>  geom_segment(size = 1.2 ,aes(y = 45, yend = 45, x = -180, xend = 0), colour = &quot;gray&quot;) +<br>  geom_segment(size = 1.2 ,aes(y = 45, yend = 45, x = 180, xend = 0), colour = &quot;gray&quot;) +<br>  <br>  geom_segment(size = 0.1 ,aes(y = 55, yend = 55, x = -180, xend = 0), linetype = &quot;dashed&quot;) +<br>  geom_segment(size = 0.1 ,aes(y = 55, yend = 55, x = 180, xend = 0), linetype = &quot;dashed&quot;) +<br>  <br>  geom_segment(size = 0.1 ,aes(y = 70, yend = 70, x = -180, xend = 0), linetype = &quot;dashed&quot;) +<br>  geom_segment(size = 0.1 ,aes(y = 70, yend = 70, x = 180, xend = 0), linetype = &quot;dashed&quot;) +<br>  <br>  geom_segment(size = 0.1 ,aes(y = 85, yend = 85, x = -180, xend = 0), linetype = &quot;dashed&quot;) +<br>  geom_segment(size = 0.1 ,aes(y = 85, yend = 85, x = 180, xend = 0), linetype = &quot;dashed&quot;)<br>  <br>iceMap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*gqorGMicWMqzBy-Es-Zpeg.png" /><figcaption>Map of sea ice extent produced in R</figcaption></figure><p>With a set of additional code lines it is possible to generate a projection of sea ice extent for the future (year 2100), here with an example under the Representative Concentration Scenario 6.0.</p><pre>iceMapMin &lt;- load_layers(&quot;BO21_RCP60_2100_icethickltmin_ss&quot;)<br>iceMapMax &lt;- load_layers(&quot;BO21_RCP60_2100_icethickltmax_ss&quot;)</pre><pre>library(gridExtra)<br>grid.arrange(iceMapPresent, iceMapFuture, ncol=2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrGvII-KjZC1lUlP-ziYFg.png" /><figcaption>Map of sea ice extent produced in R for (left) present-day conditions and (right) the year 2100 under RCP6.0.</figcaption></figure><p><strong>How to cite the code: </strong>Assis, J., Tyberghein, L., Bosch, S., Verbruggen, H., Serrão, E.A. &amp; De Clerck, O. (2017) Bio-ORACLE v2.0: Extending marine data layers for bioclimatic modelling. <em>Global Ecology and Biogeography</em>, <strong>27</strong>, 277–284.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14c3366b6e13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Downloading multiple biodiversity records from iNaturalist using Python]]></title>
            <link>https://jorgemfa.medium.com/downloading-multiple-biodiversity-records-from-inaturalist-using-python-e01dfbb29f6b?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/e01dfbb29f6b</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[featured]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[biodiversity]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Mon, 14 Sep 2020 15:42:16 GMT</pubDate>
            <atom:updated>2021-02-06T09:34:41.406Z</atom:updated>
            <content:encoded><![CDATA[<h3>Downloading biodiversity records from iNaturalist with Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*63lBZE5bFq4WCGgV" /></figure><p>iNaturalist is a global platform where naturalists, citizen scientists, and biologists post their observations with photographs. Observations can be curated by the network of users to provide valuable open data to scientific research projects, conservation agencies and the general public. In particular, the data has been used to describe the global distribution of species, address niche-based questions, support biodiversity and ecosystem-based conservation, and to understand correlations between anthropogenic pressures and population extinctions.</p><p>Data may be accessed via its <a href="https://inaturalist.org/">website</a>, <a href="https://itunes.apple.com/us/app/inaturalist/id421397028?mt=8">mobile application</a> or <a href="https://api.inaturalist.org/v1/">API</a>. Here I provide some line of python code to automatically download multiple records from iNaturalist using the API. In this particular case, the code will get all data for the Parque Marinho Luiz Saldanha, a Marine Protected Area located in Portugal.</p><pre># import dependencies</pre><pre>from requests import request<br>import json<br>from pandas.io.json import json_normalize<br>import pandas as pd<br>import urllib.request<br>import os</pre><pre># Get all records for Parque Marinho Luiz Saldanha</pre><pre>outputFolder = &#39;/theFolderToSaveData&#39;<br>placeID = &#39;128892&#39;</pre><pre>if not os.path.exists(outputFolder):<br>    os.makedirs(outputFolder)</pre><pre>df = pd.DataFrame([])</pre><pre>iteraction = 0<br>dataSize = 1<br>while (dataSize &gt; 0):     <br>    iteraction = iteraction + 1<br>    url = &#39;<a href="https://api.inaturalist.org/v1/observations?geo=true&amp;identified=true&amp;place_id=&#39;+placeID+&#39;&amp;rank=species&amp;order=desc&amp;order_by=created_at&amp;page=&#39;+str(iteraction)+&#39;&amp;per_page=200&#39;">https://api.inaturalist.org/v1/observations?geo=true&amp;identified=true&amp;place_id=&#39;+placeID+&#39;&amp;rank=species&amp;order=desc&amp;order_by=created_at&amp;page=&#39;+str(iteraction)+&#39;&amp;per_page=200&#39;</a><br>    response = requests.get(url)<br>    dictr = response.json()<br>    recs = dictr[&#39;results&#39;]<br>    dataSize = len(recs)<br>    data = json_normalize(recs)<br>    if dataSize &gt; 0:<br>        df = df.append(data)</pre><pre># Save images to the folder</pre><pre>for x in range(0, len(df)):<br>    id = df[&#39;id&#39;].values[x]<br>    imageURL = json_normalize(df[&#39;photos&#39;].values[x])[&#39;url&#39;].values[0]<br>    imageURLM = imageURL.replace(&quot;square&quot;, &quot;medium&quot;)<br>    imageURLO = imageURL.replace(&quot;square&quot;, &quot;original&quot;)<br>    urllib.request.urlretrieve(imageURL, outputFolder+&#39;/&#39;+str(id)+&#39;Sq.jpg&#39;)<br>    urllib.request.urlretrieve(imageURLM, outputFolder+&#39;/&#39;+str(id)+&#39;M.jpg&#39;)<br>    urllib.request.urlretrieve(imageURLO, outputFolder+&#39;/&#39;+str(id)+&#39;O.jpg&#39;)</pre><pre># Prepare pandas data.frame and export to csv</pre><pre>list(df.columns)</pre><pre>dfLatitude = df[&quot;location&quot;].str.split(&quot;,&quot;, expand = True)[0]<br>dfLongitude= df[&quot;location&quot;].str.split(&quot;,&quot;, expand = True)[1]</pre><pre>df1 = df[[&#39;id&#39;,&#39;taxon.name&#39;, &#39;quality_grade&#39;, &#39;time_observed_at&#39;, &#39;species_guess&#39;, &#39;license_code&#39;, &#39;observed_on&#39;,  &#39;community_taxon_id&#39;]]</pre><pre>df1 = pd.concat([df1, dfLongitude, dfLatitude], axis=1)<br>df1.columns = [&#39;id&#39;,&#39;taxon.name&#39;, &#39;quality_grade&#39;, &#39;time_observed_at&#39;, &#39;species_guess&#39;, &#39;license_code&#39;, &#39;observed_on&#39;,  &#39;community_taxon_id&#39;,&#39;Longitude&#39;,&#39;Latitude&#39;]</pre><pre>df1.to_csv(outputFolder+&#39;/dataFrame.csv&#39;, sep=&#39;\t&#39;, header=True)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e01dfbb29f6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reducing spatial autocorrelation in Species Distribution Modelling]]></title>
            <link>https://jorgemfa.medium.com/reducing-spatial-autocorrelation-in-species-distribution-models-fe84d4269cee?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe84d4269cee</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[featured]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[biodiversity]]></category>
            <category><![CDATA[modelling]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Wed, 05 Aug 2020 23:23:23 GMT</pubDate>
            <atom:updated>2020-08-06T13:23:52.680Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-ELhShxU3lup05O2" /></figure><p>Species distribution models (SDM; for review and definition see, e.g., Peterson et al., 2011) are a dominant paradigm to quantify the relationship between environmental dynamics and several manifestations of species biogeography. These statistical approaches pushed an emerging body of research describing the global distribution of species, addressing niche-based questions, supporting biodiversity conservation and ecosystem-based management, as well as infering the likely anthropogenic pressures leading to population turnover and extinction.</p><p>Spatial autocorrelation (SA) is a common challenge while modelling the distribution and abundance of species. This phenomenon, likely present in most ecological datasets, denotes the situation where the values of variables sampled at nearby locations are not independent due to correlation with values at nearby locations (i.e., the value of a predictor variable at a given site can be partially predicted by the values at neighbouring sites).</p><p>Accounting for SA has not received much attention in applied SDM studies, however, when present, it may result in poorly specified models and inappropriate spatial inference and prediction. Recent studies proposed to incorporate SA into the actual models while predicting distributions (coined ‘spatial models’; Dormann, 2007), however, this approach does not allow to transfer models to new independent data (e.g., temporal and spatial transferability).</p><p>I propose a straightforward approach to reduce the effect of SA in SDM (see also Boavida et al., 2016 for more details). I use a simple example bellow focused on a brown algae species capable of producing marine forests and a set of environmental predictors known to largely explain its distribution.</p><pre><strong>Get the R code: Reducing spatial autocorrelation<br></strong><a href="https://github.com/jorgeassis/spatialAutocorrelation">https://github.com/jorgeassis/spatialAutocorrelation</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9_WPvUEfbs0ygOdaCB6LkQ.png" /><figcaption>Fig. Initial set of occurrence records with potential negative effect of spatial autocorrelation.</figcaption></figure><p>1. A correlogram is produced to assess the correlation of each variable predictor within a range of geographic distances.</p><p>2. For each distance class, a linear model tests the effect of correlation with geographic distance. This finds the minimum non-significant autocorrelated distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X8hGE-aNibfuQK4aGA-KQ.png" /><figcaption>Fig. Correlogram of a variable predictor within a range of distances (Open circles: non-significant correlation).</figcaption></figure><p>3. The average of the minimum non-significant distances found per variable is used to prune the occurrence records, by leaving only one record within such distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VTPXkFXBLck2xFm1HNDxUQ.png" /><figcaption>Fig. Minimum and average (dashed line) non-significant autocorrelated distances of variable predictors.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hstqVYH6U5UNJSRipt4m-A.png" /><figcaption>Fig. Final pruned dataset of occurrence records with reduced potential effect of spatial autocorrelation.</figcaption></figure><pre><strong>Get the R code: Reducing spatial autocorrelation<br></strong><a href="https://github.com/jorgeassis/spatialAutocorrelation">https://github.com/jorgeassis/spatialAutocorrelation</a></pre><h3>Literature cited</h3><p>C. F. Dormann (2007) Effects of incorporating spatial autocorrelation into the analysis of species distribution data. <em>Global Ecology and Biogeography.</em> 16, 129–138.</p><p>Peterson, A.T., Soberon, J., Pearson, R.G., Anderson, R.P., Martinez-Meyer, E., Nakamura, M. &amp;Araujo, M.B. (2011) Ecological niches and geographic distributions. <em>Monographs in Population Biology</em>, 314 pp. Vol. 49. Princeton University Press, Princeton.</p><p>Boavida, J., Assis, J., Silva, I. <em>et al. </em>(2016) Overlooked habitat of a vulnerable gorgonian revealed in the Mediterranean and Eastern Atlantic by ecological niche modelling. <em>Scientific Reports.</em> 6<strong>, </strong>36460.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe84d4269cee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Producing a landmass shapefile of the Last Glacial Maximum in R]]></title>
            <link>https://jorgemfa.medium.com/producing-a-landmass-shapefile-of-the-last-glacial-maximum-in-r-1fb38b12b614?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fb38b12b614</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[featured]]></category>
            <category><![CDATA[oceans]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 15:58:09 GMT</pubDate>
            <atom:updated>2020-02-21T13:48:09.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yRKKEW1xmxJv3zAu" /></figure><p>The major cause of global sea-level change is the exchange of water between ice and ocean during ice ages. The <a href="https://en.wikipedia.org/wiki/Last_Glacial_Maximum">Last Glacial Maximum</a> (LGM) was the most recent period with ice sheets at their greatest extent (maximum coverage between 26,500 and 19,000 years ago).</p><p>Massive ice sheets covered much of Northern Europe, North America and Asia and significantly affected global climate with increasing drought and desertification. <strong>Sea levels dropped about 120 meters</strong> (about 410 feet) when compared to today. This <strong>lead to exposed continental shelves, joined land masses and extensive coastal plains</strong>.</p><p>Here are a few lines of R code to produce a landmass shapefile of the Last Glacial Maximum for Geographic Information Systems. The code uses a bathymetry raster layer extracted from <a href="http://www.bio-oracle.org/">Bio-ORACLE</a>, an open source dataset of GIS layers that provides geophysical, biotic and environmental data for surface and benthic marine realms.</p><pre>library(raster)<br>library(rgdal)<br>library(rgeos)</pre><pre>bathymetryFile &lt;- &quot;<a href="https://github.com/jorgeassis/rGIS/blob/master/Data/BathymetryDepthMean.tif">https://github.com/jorgeassis/rGIS/blob/master/Data/BathymetryDepthMean.tif</a>&quot;</pre><pre>bathymetry &lt;- raster(bathymetryFile)<br>rclmat &lt;- matrix(c(-Inf,-121,NA,-120,0,1,NA,NA,1), ncol=3, byrow=TRUE)<br>bathymetry &lt;- reclassify(bathymetry, rclmat)<br>plot(bathymetry)</pre><p>The first section of the code reclassifies bathymetry to a binomial layer where depths above -120m are considered as landmass.</p><pre>bathymetryPoly &lt;- rasterToPolygons(bathymetry, fun=NULL, n=4, na.rm=TRUE, digits=6, dissolve=TRUE)<br>plot(bathymetryPoly)<br>writeOGR(bathymetryPoly, &quot;.&quot;, &quot;landmassLGMPolygon&quot;, driver=&quot;ESRI Shapefile&quot;)</pre><p>The second section uses a simple function to transform the binomial layer into a polygon. This is saved as a shapefile for Geographic Information Systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VO1jI6KfOqXWXozlVFc8Q.png" /><figcaption>Landmass polygon of the Last Glacial Maximum</figcaption></figure><pre>ggplot() +<br>  geom_polygon(data = bathymetryPoly, aes(x = long, y = lat, group = group), fill=&quot;#848484&quot;, colour = NA) +<br> geom_path(data = bathymetryPoly, aes(x = long, y = lat, group = group), color = &quot;#848484&quot;, size = 0.1) +<br>  coord_equal() + <br>  theme_minimal() +<br>  theme( axis.text = element_blank(),axis.ticks = element_blank(),axis.title = element_blank() )</pre><p>The third section uses ggplot package to produce a map with landmass of the Last Glacial Maximum.</p><p><strong>Permanent repository:</strong> <a href="https://github.com/jorgeassis/rGIS/tree/master/Projects/landMassFromBathymetry">github.com/jorgeassis/</a></p><p><strong>How to cite the code: </strong>Assis, J., Tyberghein, L., Bosch, S., Verbruggen, H., Serrão, E.A. &amp; De Clerck, O. (2017) Bio-ORACLE v2.0: Extending marine data layers for bioclimatic modelling. <em>Global Ecology and Biogeography</em>, <strong>27</strong>, 277–284.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fb38b12b614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Standardized population genetic diversity in R]]></title>
            <link>https://jorgemfa.medium.com/standardized-population-genetic-diversity-in-r-d96416859902?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/d96416859902</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[genetics]]></category>
            <category><![CDATA[biodiversity]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Thu, 05 Dec 2019 13:30:04 GMT</pubDate>
            <atom:updated>2019-12-06T10:24:45.171Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IbuG91jjkbOG_VQ1" /></figure><p>Genetic diversity estimation per site or group of sites can be biased due to unbalanced sampling designs. There is an expected relationship between the number of sampled individuals in a single population and genetic diversity (e.g., as allelic richness; the total number of alleles).</p><p>To overcome the issue, standardized allelic richness and standardized number of private alleles can be determined to the smallest number of individuals within sites or group of sites under multiple randomizations.</p><p>The sites or groups of sites with higher standardized genetic diversity than the global mean can be also assessed by testing the proportion of randomizations retrieving higher values than observed.</p><p><strong>R code: Standardized population genetic diversity</strong></p><pre># Source main function</pre><pre>source(&quot;<a href="https://raw.githubusercontent.com/jorgeassis/rambo/master/Script.R">https://raw.githubusercontent.com/jorgeassis/rambo/master/Script.R</a>&quot;)</pre><pre># Get example data file at: <a href="https://github.com/jorgeassis/rambo">github.com/jorgeassis/rambo</a></pre><pre>main.data.file &lt;- &quot;<a href="https://github.com/jorgeassis/rambo/blob/master/sampleData.gtx">sampleData.gtx</a>&quot;</pre><pre>missing.data &lt;- 0<br>replace &lt;- FALSE<br>ncode &lt;- 3<br>resample.number.auto &lt;- FALSE<br>resample.number &lt;- 20<br>discard.pops &lt;- NULL<br>number.iteractions &lt;- 999<br>alfa.test &lt;- 0.05<br>savefile &lt;- FALSE<br>save.filename &lt;- &quot;richness&quot;</pre><pre># Define a vector to cluster populations</pre><pre>clustering.vector &lt;- c(1,1,2,2)<br></pre><pre># Run function</pre><pre>Rambo(main.data.file, missing.data, ncode, replace, resample.number.auto, resample.number, discard.pops, number.iteractions, alfa.test, clustering.vector, savefile, save.filename)</pre><p><strong>Main citation</strong></p><p>Assis, J., Coelho, N. C., Lamy, T., Valero, M., Alberto, F., &amp; Serrão, E. A. (2016). Deep reefs are climatic refugia for genetic diversity of marine forests. Journal of Biogeography, (43), 833–844. <a href="https://doi.org/10.1111/jbi.12677">https://doi.org/10.1111/jbi.12677</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d96416859902" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy to use marine climate layers for ecological modelling]]></title>
            <link>https://jorgemfa.medium.com/easy-to-use-marine-climate-layers-for-ecological-modelling-83950cd7a75f?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/83950cd7a75f</guid>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[featured]]></category>
            <category><![CDATA[modelling]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Wed, 04 Dec 2019 22:57:24 GMT</pubDate>
            <atom:updated>2019-12-22T23:40:27.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iPgw41gn2VjMjRT5" /></figure><p>The availability of high-resolution global environmental datasets is crucial to model the relationship between the occurrence or abundance of species and their natural environment. For terrestrial environments, <a href="https://www.worldclim.org/">WorldClim</a> has served this purpose since the early 2000s, significantly improving the application in the fields of ecology, biogeography, conservation biology and evolution.</p><p>Equivalent data for the marine realm only became available in 2012, with the pioneer initiative <a href="http://www.bio-oracle.org/">Bio-ORACLE</a> providing data for several ecologically relevant variables. A <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/geb.12693">new update</a> of this dataset includes the most recent Intergovernmental Panel on Climate Change (IPCC) scenarios and new present-day variables like sea ice thickness, dissolved iron, phytoplankton, primary productivity and light at the bottom. The update also includes near sea bottom layers, which allow modelling a large fraction of the benthic diversity that inhabits deeper habitats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBFTXHjk-68mZPAu5dggtA.png" /><figcaption>Mean benthic ocean temperature for the present (source: <a href="http://www.bio-oracle.org/">Bio-ORACLE</a>)</figcaption></figure><p>The relevance of new data aiming for species associated with sea benthic features is clearly underlined by the disparity in ocean temperatures between surface and benthic layers, which can amount to up to 28.8 8C in the deeper regions of lower latitudes (Figure).</p><p>The reliability of data layers was further tested using a cross-validation framework against in situ quality controlled data. This showed a generally good agreement between data layers and the global climatic patterns.</p><p>The R package <a href="https://cran.rstudio.com/web/packages/sdmpredictors/index.html">sdmpredictors</a> facilitates listing, extraction and management of the data layers provided by <a href="http://www.bio-oracle.org/">Bio-ORACLE</a>, as well as easy integration with the available pipelines for bioclimatic modelling.</p><p><strong>Sample R code: Plotting maximum temperature at the sea bottom</strong></p><pre># Load package<br>library(sdmpredictors)</pre><pre># Download data layer (Maximum Temperature at the sea bottom)<br>temp.max.bottom &lt;- load_layers(&quot;BO2_tempmax_bdmax&quot;)</pre><pre># Crop raster to fit the North Atlantic<br>ne.atlantic.ext &lt;- extent(-100, 45, 30.75, 72.5)<br>temp.max.bottom.crop &lt;- crop(temp.max.bottom, ne.atlantic.ext)</pre><pre># Generate a nice color ramp and plot the map<br>my.colors = colorRampPalette(c(&quot;#5E85B8&quot;,&quot;#EDF0C0&quot;,&quot;#C13127&quot;))<br>plot(temp.max.bottom.crop,col=my.colors(1000),axes=FALSE, box=FALSE)<br>title(cex.sub = 1.25, sub = &quot;Maximum temperature at the sea bottom (ºC)&quot;)</pre><p><strong>Sample R code: Extracting environmental data for a set of sites</strong></p><pre># Load packages (leaflet allows to load google maps)<br>library(sdmpredictors)<br>library(leaflet)</pre><pre># List layers avaialble in Bio-ORACLE v2<br>layers.bio2 &lt;- list_layers( datasets=&quot;Bio-ORACLE&quot; )<br>layers.bio2</pre><pre># Download data layers (Max. Temperature, Min. Salinity and Min. Nitrates at the sea bottom)<br>environment.bottom &lt;- load_layers( layercodes = c(&quot;BO2_tempmax_bdmean&quot; , &quot;BO2_salinitymin_bdmean&quot;, &quot;BO2_nitratemin_bdmean&quot;) , equalarea=FALSE, rasterstack=TRUE)</pre><pre># Download bathymetry<br>bathymetry &lt;- load_layers(&quot;BO_bathymean&quot;)</pre><pre># Generate a data.frame with the sites of interest<br>my.sites &lt;- data.frame(Name=c(&quot;Faro, Portugal, NE Atlantic&quot; , &quot;Maspalomas, Spain, NE Atlantic&quot; , &quot;Guadeloupe, France, Caribbean Sea&quot; , &quot;Havana, Cuba, Caribbean Sea&quot;) , Lon=c(-7.873,-15.539,-61.208,-82.537) , Lat=c(37.047, 27.794,15.957,23.040 ) )<br>my.sites</pre><pre># Visualise sites of interest in google maps<br>m &lt;- leaflet()<br>m &lt;- addTiles(m)<br>m &lt;- addMarkers(m, lng=my.sites$Lon, lat=my.sites$Lat, popup=my.sites$Name)<br>m</pre><pre># Extract environmental values from layers<br>my.sites.environment &lt;- data.frame(Name=my.sites$Name , depth=extract(bathymetry,my.sites[,2:3]) , extract(environment.bottom,my.sites[,2:3]) )<br>my.sites.environment</pre><p>The data available in Bio-ORACLE are documented in two articles:</p><p>Assis, J., Tyberghein, L., Bosh, S., Verbruggen, H., Serrão, E. A., &amp; De Clerck, O. (2017). Bio-ORACLE v2.0: Extending marine data layers for bioclimatic modelling. Global Ecology and Biogeography, 27, 277–284.</p><p>Tyberghein L, Verbruggen H, Pauly K, Troupin C, Mineur F, De Clerck O (2012) Bio-ORACLE: A global environmental dataset for marine species distribution modelling. Global Ecology and Biogeography, 21, 272–281.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83950cd7a75f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ice Ages and the Genetic Legacy of the Oceans]]></title>
            <link>https://medium.com/sea-change/climate-change-drives-biodiversity-levels-of-marine-species-3e2114c19488?source=rss-1cc35d3d8e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e2114c19488</guid>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[biodiversity]]></category>
            <category><![CDATA[marine]]></category>
            <category><![CDATA[oceans]]></category>
            <category><![CDATA[genetics]]></category>
            <dc:creator><![CDATA[biodiversityDS.]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 15:03:21 GMT</pubDate>
            <atom:updated>2024-05-09T09:33:03.703Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KyubZYBDSgbZXu8x" /><figcaption>Photo by <a href="https://unsplash.com/@r3dmax?utm_source=medium&amp;utm_medium=referral">Jonatan Pie</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>How Ice Ages and Climate Change Shaped the Seas</strong></p><p>Did you know our oceans haven’t always looked the same? Turns out, the coming and going of massive ice ages — especially the <a href="https://en.wikipedia.org/wiki/Last_Glacial_Maximum">Last Glacial Maximum</a> — have dramatically shifted where sea creatures live.</p><p>The Last Glacial Maximum was a harsh time. Giant ice sheets pushed many cold-loving species far south. Think of it like a massive game of ocean-wide musical chairs. As the climate warmed, some populations that survived found their way back north, but things had permanently changed.</p><p><strong>Genetic Footprints of the Past</strong></p><p>These changes left marks in the very DNA of marine species. Areas where critters held out during those icy times show a lot of genetic diversity — it’s like a super-rich gene pool of possibilities. Areas newly colonized, well, they tend to be a bit less diverse.</p><p><strong>A Study on Seaweed Tells a Story</strong></p><p>In a <a href="https://onlinelibrary.wiley.com/doi/abs/10.1111/mec.12772">recent study</a>, researcher dug into the story of Fucus vesiculosus, a type of brown seaweed. They used fancy computer models to map where this seaweed likely lived in the past vs. where we find it today. The results were super cool! It turns out, today’s areas with the most seaweed genetic diversity were spots it likely hung tough during colder times. That matches an idea called niche conservatism — basically, that species like the conditions they’ve always known. The study also showed that areas gained by seaweed as ice retreated hold distinct genetic profiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5RAn6TCYc7abNaUHcMARhQ.jpeg" /><figcaption>Fucus vesiculosus, a brown large algae capable of structuring importante marine forests.</figcaption></figure><p>The unfortunate part? This research suggests that as our climate warms again, we might lose unique seaweed populations along the southern edge of their range. That means losing precious genetic diversity.</p><p><strong>Why This Matters</strong></p><p>Stories like this show us that climate change isn’t just about temperatures. The way it reshuffles entire ecosystems leaves a lasting mark on the very building blocks of ocean life.</p><p>Let me know if you’d like any part of this made more conversational or if you want more focus on specific points!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e2114c19488" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sea-change/climate-change-drives-biodiversity-levels-of-marine-species-3e2114c19488">Ice Ages and the Genetic Legacy of the Oceans</a> was originally published in <a href="https://medium.com/sea-change">Sea change</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>