Skip to content

R code for the joint estimation of sampling effort and species distributions from species occurrences, a simulation example and application to Pl@ntNet data

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENCE.txt
Notifications You must be signed in to change notification settings

ChrisBotella/SamplingEffort

Repository files navigation

SamplingEffort

R code for the joint estimation of sampling effort and species distributions from species occurrences, a simulation example and application to Pl@ntNet data.

Simulation experiment

Prerequisites

R version 3.5.1 or superior (I didn't check earlier versions). Install librairies: glmnet, raster, ggplot2, data.table.

Reproduce the experiment

  1. Download all the repository (zip file SamplingEffort-master.zip) and unzip the whole directory SamplingEffort-master locally.
  2. Open script Simu_and_graphs.R and modify the dir variable to the location of the SamplingEffort-master directory.
  3. Run Simu_and_graphs.R with R.
  4. The individual graphs are saved as .png images in the SamplingEffort-master directory.

Real data illustration

Prerequisites

  1. Having a machine with >60Gb of RAM (for model default settings). It's required to carry out the construction of the sparse model matrix and glmnet fitting process, and R will crash if there's not enough memory available. Decreasing the number of background points per sampling cell - variable n in plantnet_effort.R - will approximately reduce the memory consumption by the same factor, but may entail bias in the model fit, or even identifiability problems.
  2. Install librairies: glmnet, data.table, raster, rgdal, rgeos, grid, ggplot2, plyr.
  3. Download all the repository (zip file SamplingEffort-master.zip) and unzip the whole directory SamplingEffort-master locally.
  4. Download the Pl@ntNet occurrences data: Botella Christophe, Bonnet Pierre, Joly Alexis, Lombardo Jean-Christophe, & Affouard Antoine. (2019). Pl@ntNet queries 2017-2018 in France (Version 0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.2634137 And move the files PL_complete.csv and taxaName_glc19SpId_InTest.csv to the SamplingEffort-master directory.
  5. Download the environmental rasters zip : Botella Christophe. (2019). A compilation of environmental geographic rasters for SDM covering France (Version 1) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.2635501 And unzip it inside the SamplingEffort-master directory.

Reproduce the model fit and graphs

  1. Open script plantnet_effort.R and modify the dir variable to the location of the SamplingEffort-master directory.
  2. Run plantnet_effort.R with R. (It will take a while... Go for day hike. If, for any reason, it crashes during glmnet fit, you may restart the script from the Fit and save model section as the required temporary have been stored on disk)
  3. The graphs illustrating the relative sampling effort, the species intensity and the species occurrences over France are saved as .png images in the SamplingEffort-master directory.

About

R code for the joint estimation of sampling effort and species distributions from species occurrences, a simulation example and application to Pl@ntNet data

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENCE.txt

Stars

Watchers

Forks

Packages

No packages published

Languages