Source code for fitting the Integrated Species Distribution Model for pikeperch (Sander lucioperca) larvae in Porvoo-Sipoo archipelago as described in 10.1002/ecog.08173.
This code has been developed and tested with Ubuntu 20.04 and 22.04, although it should run on other Linux distributions as well. The code may work on other operating systems, such as Windows or Mac, but these have not been tested.
- Python 3 is required for some small utility packages, such as csvkit for aggregating model comparison metrics.
GDAL,GEOSandPROJlibraries are needed to install some spatial R packages, such asterra. On Ubuntu, these can be installed withsudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev libsqlite0-dev.
GNU Make version 4.2.1 or newer is used for installing other dependencies and for fitting the models.
The code itself is developed using R-4.2.2 with packages listed in the renv.lock file. These are automatically installed with the Makefile.
The code in this repository is meant to be used with GNU Make, which will install the dependencies and produce all of the results files based on the recipes in Makefile. A brief description of the make targets can be viewed with make help. The targets used for producing the main results are install, fit_model and sensitivity.
Since many of the targets can take a while to produce, we recommend using the dry-run option -n first to see what steps are needed for a particular target.
Once the requirements above are met, other requirements can be installed simply by running make install on a terminal in the project folder.
The results for fitting a model will be saved in the results/ folder.
Note that the fitting a model may take some time. On our research group's server, using 20 CPU cores, fitting the example model below required approximately one hour.
After installation, an example model can be fitted with make fit_model and its results summarized with make result_files. All of the resulting files will be saved in the results/example_results/ folder by default.
You can run the sensitivity analysis, where the amount of training data is gradually increased with make sensitivity. The results will appear in the results/sensitivity_analysis/ folder.
You may produce all of the steps with the command make all or simply make. Note that the model fitting portions of this may take several hours in total, depending on the computer.