Living Planet Index for South Africa
# Calculating a national Living Planet Index for South Africa
This repository contains the code and data to replicated the results from the manuscript:
* Buschke, F.T. & von Staden, L. (2025). The South African Living Planet Index shows the value of a supposedly ‘uninformative’ indicator. *Animal Conservation*, 28, 854-863.
Its content was accurate as of 05 June 2024. For any enquiries, please contact `falko.buschk@gmail.com`.
## :warning: IMPORTANT UPDATE :warning:
**Since developing this code repository and publishing our paper, there has been an update to the `rlpi` package**: rlpi GitHub repository.
This affects the calculation for the freshwater LPI because it alters the measured population trends of on species, the little stint, *Calidris minuta* (`Population ID12344`). So, to replicate our analysis more closely, we have removed this species from the analysis.
## Required libraries
The code presented here relies on the dedicated `rlpi (v0.1.0)` package for calculating the *Living Planet Index*. This code is not on the official CRAN repository, so it must be accessed and installed directly from the rlpi GitHub repository, which also requires the `devtools (v2.4.5.)` package. The code needed to install these packages is included in the R-scripts.
**Note:** This code runs without error using R version `4.1.3` but users with more recent version have reported errors with the `create_infile` function in the `rlpi` package. Please refer to rlpi GitHub repository should you have any difficulties installing the `rlpi` package.
```
# Start by installing and loading 'devtools' package, which is needed to install the 'rlpi' package from GitHub
install.packages("devtools")
library(devtools)
# Install from main ZSL repository online
install_github("Zoological-Society-of-London/rlpi", dependencies=TRUE)
# Load the 'rlpi' package
library(rlpi)
```
## Guidance for use
The code is self-contained to replicate the results. However, the working directory must inclu …