<br><div align="justify">  <span><span><span>Hi there!<br><br>    Over the last few months, my lab-mate Irene Villa <span>(see more of her work <a target="_blank" href="https://www.researchgate.net/profile/Irene_Villa-Machio">here!</a>) </span></span> and I, have been discussing ecological niche overlap. The niche concept dates back to ideas first proposed by ornithologist J. Grinnell (1917). Later on, G.E. Hutchinson </span></span><span><span>(1957)</span></span><span><span> defined the ecological niche of a species as the n-dimensional hyper-volume of ecological factors that define a space where the species can exist indefinitely. These ecological factors can be either abiotic (fundamental niche) or biotic variables, and the intersection of both defines the realized niche, or potential ecological range where the species can survive. The last necessary element for the existence of a species in a particular place (actual presence or distribution) is related to the “movement” ability or dispersal capacity of the species to arrive to those places where ecological factors are suitable. This theory is nicely summarized in the <a target="_blank" href="https://www.researchgate.net/publication/5990885_Grinnellian_and_Eltonian_niches_and_geographic_distributions_of_species/figures">BAM diagram</a> (Biotic-Abiotic-Movement; Soberón, 2007).<br><br>    In the last decades, with the development of cartographic information about climatic variables (mainly temperature and precipitation) and mathematical algorithms, many research efforts have been directed towards modeling the ecological niche of species from presence records and bioclimatic information (Elith &amp; Leathwick, 2009). As these techniques were developed, many researchers focused on the comparison of ecological niches of two species, and the degree of overlap between them. A wide range of literature has been published about this topic (Peterson, 2011) but, in the last years, a general consensus has been reached about the methods to measure this overlap. Briefly, the method consist of two steps: 1) building an environmental space using bioclimatic values in the presence records and background points with any multivariate technique (usually Principal Component Analysis), and 2) representing both species niches in this space via kernel density, comparing them using D or I indexes and applying similarity or identity tests to assess significance (Warren et al., 2008).<br><br>    Following this general approach, the R package ecospat (Di Cola et al., 2016) provides an easy way to perform a Principal Component Analysis and to compare two species niches using D overlapping index, identity tests, etc. However, Irene and I, realized that, when using this approach, in many cases for which niche overlap was not obtained, this was due to the lack of overlap for just one of the two PC axes, while a complete overlap was retrieved for the other axis. Taking into account that both axes do not usually contribute equally to explain environmental space (the first axis usually explains much more variability than the following ones), we worked on a function using the ggplot2 R package to create a nice plot for visual exploration of the Principal Component scores in both axes. This plot allows us to examine the factors that are or are not producing niche overlap, since it shows three plots in one: each axis separately and the joint distribution.</span></span></div><span><span><br></span></span><span><span><br></span></span><span><span>   Here is the <a target="_blank" href="https://drive.google.com/open?id=0BzwZKMfGd8jvNFptaUV1YXRhN2c">function code</a> (too large to print here). You can download and run it in an R console. The following is an example with two wall lizards from a Mediterranean area. You can download ecological values for the 19 bioclimatic variables at presence points of these two species <a target="_blank" href="https://drive.google.com/open?id=0BzwZKMfGd8jvUF9sMkg5bGZpRWc">here</a>.</span></span><br><div align="justify"><span><span><span><br></span></span></span><span><span><span><br></span></span></span></div><div align="justify"><pre><span><span><span><code>   <br> ##########################<br> #######   EXAMPLE   ######  <br> ##########################<br>library(ecospat)<br>library(ggplot2)<br>library(grid)<br>library(gridExtra)<br>library(gtable)<br>library(RColorBrewer) <br><br> # Read wall lizards ecological data  <br><br> data_Ph_Pl&lt;-read.csv(&quot;./data_Ph_Pl.csv&quot;)  <br><br> # Note: This data represent the values for the 19 bioclimatic variables at occurrence   <br> # points for two Mediterranean wall lizards, Iberian wall lizard (Podarcis hispanicus,   <br> # mainly in Iberian Peninsula) and Lilford's wall lizard (Podarcis lilfordi, from the   <br> # Balearic Islands). Data were downloaded from GBIF* and Worldclim (http://worldclim.org/).  <br> # The first 1125 rows are the bioclimatic values for P.hispanicus presences, while the  <br> # next 44 rows represent bioclimatic values for P.lilifordi. The following rows represent   <br> # available bioclimatic conditions (background) obtained from 10000 random points   <br> # generated in a buffer of 400 km approximatively around presence points. Some inaccuracies   <br> # (such as 2 Lilford's wall lizard presences in Iberian Peninsula) were not removed (this is   <br> # just an example!!).  <br> # *Data searches:  <br> # Podarcis hispanicus: GBIF.org (30th April 2017) GBIF Occurrence Download http://doi.org/10.15468/dl.yx4fbg  <br> # Podarcis lilfordi: GBIF.org (30th April 2017) GBIF Occurrence Download http://doi.org/10.15468/dl.qqmzq3  <br><br> # From this data, we perform a Principal Component Analysis using &quot;dudi.pca&quot; function from &quot;ecospat&quot; package.  <br> # We will choose 2 axes for the environmental space representation.  <br><br> pca_Ph_Pl &lt;-dudi.pca(na.omit(data_Ph_Pl, center = T, scale = T, scannf = F, nf = 2))  <br> 2  <br><br> # Now, we can use directly this result with the niceOverPlot function to represent a   <br> # 2D environmental space in a central plot, and each environmental gradient represented   <br> # by each axis at top and right. We must provide to the function with the number of presences  <br> # of each species in the same order as in the input data (nº of presences  <br> # for Sp1 and nº of presences for Sp2)  <br><br> niceOverPlot(pca_Ph_Pl, n1=1125 , n2= 44)  <br></code></span></span></span></pre></div><div><span><span><span><br></span></span></span></div><div><span><span><span>Results from niceOverPlot (Blue area: <i>P. lilifordi</i>; Pink area: <i>P. hispanicus</i>)</span></span></span></div><div><span><span><span><br></span></span></span></div><div><span><span><span><a href="https://4.bp.blogspot.com/-nqf-Im_q2Bo/WREUNjaKzjI/AAAAAAAAAME/MZGkInEHjUEh6EXY-vJMgDwD9DWmNE6gACLcB/s1600/niceOverlap_podarcis.png"></a></span></span></span></div><div><span><span><span>       </span></span></span></div><div><span><span><span><br></span></span><span><span><span>  <span>This plot could help us to interpret the results obtained from niche overlap analysis for these two species. In this example, we can see that, in 2D environmental space, the bioclimatic preferences of the two wall lizard species do not overlap. But you can notice that this lack of overlap is due to Axis2 of the PCA, which represents around 18% of contribution in environmental space. Now, we can focus on the bioclimatic variables that are involved in this axis to understand which factors are preventing the overlap.</span></span></span></span></span></div><div>In upcoming posts, we will discuss some alternative ways to address the D overlap index to take into account cases like our example.</div><div><br><span>Have fun!</span></div><div><span><span><br></span></span></div><div><span><span><a href="https://1.bp.blogspot.com/-5ndjdbgAmRY/WREPcDNFcGI/AAAAAAAAALo/uNkIz7VEg_IkJMYxEyr_D7Y0fIC65xDkACLcB/s1600/Pl.png"></a></span></span></div><div><i>Podarcis lilifordi,</i> from the Balearic Islands<br><br><div> References<br><br><br>-Soberón, J. (2007). Grinnellian and Eltonian niches and geographic distributions of species. Ecology letters, 10(12), 1115-1123.<br><br>-Elith, J., &amp; Leathwick, J. R. (2009). Species distribution models: ecological explanation and prediction across space and time. Annual review of ecology, evolution, and systematics, 40, 677-697.<br><br>-Peterson, A. T. (2011). Ecological niche conservatism: A time‐structured review of evidence. Journal of Biogeography, 38(5), 817-827.<br><br>-Di Cola, V., Broennimann, O., Petitpierre, B., Breiner, F. T., D'Amen, M., Randin, C., ... &amp; Pellissier, L. (2016). ecospat: an R package to support spatial analyses and modeling of species niches and distributions. Ecography.</div></div>