{"id":325935,"name":"Living Planet Index","description":"The diversity-weighted Living Planet Index: controlling for taxonomic bias in a global biodiversity indicator.","url":"https://github.com/zoological-society-of-london/rlpi","last_synced_at":"2026-05-22T17:02:37.984Z","repository":{"id":28209150,"uuid":"31712920","full_name":"Zoological-Society-of-London/rlpi","owner":"Zoological-Society-of-London","description":"The rlpi package can calculate indices using the Living Planet Index methodology, as presented in McRae et al. *The diversity-weighted Living Planet Index: controlling for taxonomic bias in a global biodiversity indicator*.","archived":false,"fork":false,"pushed_at":"2026-05-04T22:22:14.000Z","size":17751,"stargazers_count":37,"open_issues_count":5,"forks_count":21,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-05-16T14:03:24.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.livingplanetindex.org","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"reproducible-research/scipy-tutorial-2014","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zoological-Society-of-London.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-03-05T12:34:50.000Z","updated_at":"2026-05-04T22:22:18.000Z","dependencies_parsed_at":"2025-10-04T00:21:20.915Z","dependency_job_id":"70374c42-c6b6-4075-b0ac-831253e04e02","html_url":"https://github.com/Zoological-Society-of-London/rlpi","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Zoological-Society-of-London/rlpi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zoological-Society-of-London","download_url":"https://codeload.github.com/Zoological-Society-of-London/rlpi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33356136,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"Zoological-Society-of-London","name":"Zoological Society of London","uuid":"6051597","kind":"organization","description":"","email":null,"website":"http://www.zsl.org","location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/6051597?v=4","repositories_count":7,"last_synced_at":"2024-03-27T07:15:29.207Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/Zoological-Society-of-London","funding_links":[],"total_stars":32,"followers":4,"following":0,"created_at":"2022-11-05T15:02:19.546Z","updated_at":"2024-03-27T07:15:29.763Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zoological-Society-of-London","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zoological-Society-of-London/repositories"},"packages":[],"commits":{"id":11448225,"full_name":"zoological-society-of-london/rlpi","default_branch":"master","total_commits":120,"total_committers":7,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":17.142857142857142,"dds":0.6166666666666667,"past_year_total_commits":7,"past_year_total_committers":1,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":7.0,"past_year_dds":0.0,"last_synced_at":"2026-05-20T16:03:15.143Z","last_synced_commit":"bfa317723cd2c5cf4ab36b27524535a11d50dd3f","created_at":"2025-10-04T00:16:17.532Z","updated_at":"2026-05-20T16:02:49.610Z","committers":[{"name":"robinfreeman","email":"robinfreeman@ioz.ac.uk","login":null,"count":46},{"name":"robinfreeman","email":"robin.freeman@ioz.ac.uk","login":"robinfreeman","count":41},{"name":"stefaniedeinet","email":"stefanie.deinet@ioz.ac.uk","login":"stefaniedeinet","count":22},{"name":"valemarc","email":"15122115+valemarc","login":"valemarc","count":3},{"name":"LouiseMcRae","email":"louise.mcrae@ioz.ac.uk","login":"LouiseMcRae","count":3},{"name":"James Watmuff","email":"james@planticle.com.au","login":"ammojamo","count":3},{"name":"Robin Freeman","email":"freeman.r@ZSL04573.home","login":null,"count":2}],"past_year_committers":[{"name":"robinfreeman","email":"robin.freeman@ioz.ac.uk","login":"robinfreeman","count":7}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoological-society-of-london%2Frlpi/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-05-22T00:00:12.925Z","repositories_count":6237866,"commits_count":884460880,"contributors_count":34892846,"owners_count":1155987,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"Zoological-Society-of-London/rlpi","html_url":"https://github.com/Zoological-Society-of-London/rlpi","last_synced_at":"2026-05-18T15:02:38.856Z","status":"error","issues_count":14,"pull_requests_count":5,"avg_time_to_close_issue":65372591.88888889,"avg_time_to_close_pull_request":15937774.0,"issues_closed_count":9,"pull_requests_closed_count":3,"pull_request_authors_count":2,"issue_authors_count":8,"avg_comments_per_issue":1.1428571428571428,"avg_comments_per_pull_request":0.0,"merged_pull_requests_count":2,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":2,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":0.5,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2025-09-01T06:39:16.723Z","updated_at":"2026-05-18T15:02:38.856Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zoological-Society-of-London%2Frlpi/issues","issue_labels_count":{"help wanted":1},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":14},"pull_request_author_associations_count":{"NONE":4,"CONTRIBUTOR":1},"issue_authors":{"ammojamo":7,"jimjam-slam":1,"yvanlebras":1,"aornugent":1,"zyll123":1,"pipapu":1,"jessfenker":1,"ha0ye":1},"pull_request_authors":{"ammojamo":4,"Rekyt":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-05-20T00:00:29.037Z","repositories_count":14647925,"issues_count":34142047,"pull_requests_count":111842961,"authors_count":11267274,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"NONE":1},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{"zyll123":1},"past_year_pull_request_authors":{},"maintainers":[],"active_maintainers":[]},"events":{"total":{"ForkEvent":2,"IssuesEvent":2,"WatchEvent":3,"IssueCommentEvent":2,"PushEvent":2},"last_year":{"ForkEvent":1,"IssuesEvent":1,"WatchEvent":2,"IssueCommentEvent":1,"PushEvent":2}},"keywords":[],"dependencies":[{"ecosystem":"cran","filepath":"DESCRIPTION","sha":null,"kind":"manifest","created_at":"2024-03-15T14:41:35.330Z","updated_at":"2024-03-15T14:41:35.330Z","repository_link":"https://github.com/Zoological-Society-of-London/rlpi/blob/master/DESCRIPTION","dependencies":[{"id":16833637504,"package_name":"ggplot2","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637505,"package_name":"mgcv","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637521,"package_name":"plyr","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637522,"package_name":"reshape2","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637535,"package_name":"tools","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637536,"package_name":"grid","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637840,"package_name":"gtable","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637973,"package_name":"foreach","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637990,"package_name":"doParallel","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false},{"id":16833637991,"package_name":"RColorBrewer","ecosystem":"cran","requirements":"*","direct":true,"kind":"imports","optional":false}]}],"score":5.683579767338681,"created_at":"2025-10-04T00:16:04.333Z","updated_at":"2026-05-22T17:02:37.985Z","avatar_url":"https://github.com/Zoological-Society-of-London.png","language":"HTML","category":"Biosphere","sub_category":"Biodiversity Analysis and Metrics","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"---\ntitle: \"rlpi package (beta)\"\nauthor: \n  - Indicators and Assessments Research Unit, Institute of Zoology, Zoological Society of London^[Contact robin.freeman@ioz.ac.uk or louise.mcrae@ioz.ac.uk]\noutput:  \n    html_document: \n      keep_md: true  \n      toc: true\n      theme: united\n---\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(cache=TRUE)\n```\n\n##Using the rlpi package \n\n### Overview\n\nThe **rlpi** package (currently in beta/active development) calculates indices using the Living Planet Index methodology (McRae et al. (in review) *The diversity-weighted Living Planet Index: controlling for taxonomic bias in a global biodiversity indicator*).\n\n\n\u003e Note: We provide a Comma Separated Value version of the Living Planet Database [here](https://dx.doi.org/10.6084/m9.figshare.4300022.v1), but this excludes around 3000 populations which are confidential and cannot therefore be shared. Therefore, results produced with this data set may differ slightly from those presented in the manuscript and elsewhere.\n\nIn summary, indices are calculated using the geometric mean, first combining population trends to the species level, and then across higher taxonomic and geographical groupings. For example, multiple populations within a biogeographic realm will be combined first to generate individual species indices, then combined to taxonomic groups such as *birds*, *mammals*, *reptiles*, *amphibians*, and *fish* before being combined to an index for the biogeograhic realm.\n\n\nThe **rlpi** package works with source data in comma separated (csv) format where each row is composed  of **popid**, **speciesname**, **year**, **popvalue** (see below). These can be stored be in multiple groups (e.g. a file for Afrotropic bird populations, one for Afrotropical mammal populations, etc), and an 'infile' tells the package where these groups/files are and how to combine them. \n\nWhen constructing an index for just a single group, you need a single data file and a single\ninfile which points to that data file (see first example below). For multiple groups, the infile would refer to all relevant data files and can specify weightings to allow for taxonomic, geographic or other weighting.\n\nThe code below includes an example dataset for terrestrial vertebrates with a complex infile with multiple weighted groups, as well as a simple infile for Nearctic mammals.\n\nNB: At present the code combines population time-series to the species level, generating an average index for each species, then combines these into higher groups.\n\n### Installing the package and examples\n\nFirst, install the devtools package to enable installing from github:\n\n```{r rlpi_install, eval=FALSE}\ninstall.packages(\"devtools\")\n```\n\nThen install the **rlpi** package from our github:\n\n```{r install_rlpi, eval=TRUE, message=FALSE}\nlibrary(devtools)\n# Install from main ZSL repository online\ninstall_github(\"Zoological-Society-of-London/rlpi\", dependencies=TRUE)\n```\n\nThen the library can be loaded as normal\n\n```{r load_rlpi, eval=TRUE}\n# Load library\nlibrary(rlpi)\n```\n\nAnd some example data can be extracted from the package:\n\n```{r rlpi_data, eval=TRUE}\n# Get example data from package\n# Copy zipped data to local directory \nfile.copy(from=system.file(\"extdata\", \"example_data.zip\", package = \"rlpi\"), to=getwd())\n# Extract data, this will create a directory of terrestrial LPI data to construct a terrestrial index from.\nunzip(\"example_data.zip\")\n\n```\n\n## Example data\n\nWithin the example data are a number of 'infiles'. These files (take a look at them!) contain links to other files arranged into groups and include weightings. \n\nFor example **terrestrial_class_nearctic_infile.txt** which constructs an index for a single group contains:\n\n```\n\"FileName\"\t\"Group\"\t\"Weighting\"\n\"example_data/T_Nearctic_Mammalia.txt\"\t1\t0.175804093567251\n```\n\nFor now, ignore the 'group' and 'weighting' columns as they are not used for a single group. This infile references a single 'population' data file (the raw data) in the class_realms folder which, in this case, contains population counts for Nearctic mammals (again, have a look) in the following format:\n\nfirst six lines of **example_data/T_Nearctic_Mammalia.txt**:\n\n```\nBinomial\tID\tyear\tpopvalue\nOvis_canadensis\t4618\t1950\t390\nOvis_canadensis\t5328\t1950\t1500\nMyodes_gapperi\t4560\t1952\t17\nSorex_cinereus\t4587\t1952\t3\nNapaeozapus_insignis\t4588\t1952\t18\n...\n```\n\n## Creating an index using example data\n\nUsing these files to construct a Nearctic index can be done as follows:\n\n```{r nearctic_lpi, eval=TRUE, message=FALSE}\n# Make a Neactic LPI \n\n# Default gives 100 boostraps (this takes a couple of minutes to run on a 2014 Macbook)\nNearc_lpi \u003c- LPIMain(\"example_data/terrestrial_class_nearctic_infile.txt\", use_weightings = 1, VERBOSE=FALSE, show_progress=FALSE)\n\n# Remove NAs (trailing years with no data)\nNearc_lpi \u003c- Nearc_lpi[complete.cases(Nearc_lpi), ]\n# This produces a simple plot, but we can use ggplot_lpi to produce a nicer version\nggplot_lpi(Nearc_lpi, ylims=c(0, 2))\n```\n\nSimilarly, infiles are provided for Nearctic mammals and birds:\n\n```{r nearctic_mams_birds, eval=TRUE, message=FALSE}\n# Make a Neactic Mammals LPI \n# Default gives 100 boostraps (this will take a few minutes to run on a 2014 Macbook)\nNearc_mams_lpi \u003c- LPIMain(\"example_data/T_Nearctic_mammalia_infile.txt\", VERBOSE=FALSE, show_progress=FALSE)\n\n# Remove NAs (trailing years with no data)\nNearc_mams_lpi \u003c- Nearc_mams_lpi[complete.cases(Nearc_mams_lpi), ]\n# Nicer plot\nggplot_lpi(Nearc_mams_lpi, ylims=c(0, 2))\n\n# Make a Neactic Mammals LPI \n# Default gives 100 boostraps (this will take a few minutes to run on a 2014 Macbook)\nNearc_birds_lpi \u003c- LPIMain(\"example_data/terrestrial_Nearctic_Aves_infile.txt\", VERBOSE=FALSE, show_progress=FALSE)\n\n# Remove NAs (trailing years with no data)\nNearc_birds_lpi \u003c- Nearc_birds_lpi[complete.cases(Nearc_birds_lpi), ]\n# Nicer plot\nggplot_lpi(Nearc_birds_lpi, ylims=c(0, 2))\n\n# We can also combine the two LPIs together in a list\nlpis \u003c- list(Nearc_birds_lpi, Nearc_mams_lpi)\n\n# And plot them together \nggplot_multi_lpi(lpis, xlims=c(1970, 2012), ylims=c(0, 3))\n\n# We can also plot these next to each other, and use some more meaningful titles\nggplot_multi_lpi(lpis, names=c(\"Birds\", \"Mammals\"), xlims=c(1970, 2012), ylims=c(0, 3), facet=TRUE)\n\n```\n\n## Creating an index using example data (multiple groups and weightings)\n\nThis more complex example calculates an index for the terrestrial system, using the input file ***example_data/terrestrial_class_realms_infile.txt***, which has the following format:\n\n```\nFileName\tGroup\tWeighting\tWeightingB\nexample_data/T_Afrotropical_aves_pops.txt\t1\t0.387205957\t0.189737662\nexample_data/T_Afrotropical_mammalia_pops.txt\t1\t0.197833813\t0.189737662\nexample_data/T_Afrotropical_herps_pops.txt\t1\t0.41496023\t0.189737662\nexample_data/T_IndoPacific_aves_pops.txt\t2\t0.396527091\t0.292168385\nexample_data/T_IndoPacific_mammalia_pops.txt\t2\t0.172106825\t0.292168385\nexample_data/T_IndoPacific_herps_pops.txt\t2\t0.431366084\t0.292168385\nexample_data/T_Palearctic_aves_pops.txt\t3\t0.433535576\t0.116430659\nexample_data/T_Palearctic_mammalia_pops.txt\t3\t0.249862107\t0.116430659\nexample_data/T_Palearctic_herps_pops.txt\t3\t0.316602317\t0.116430659\nexample_data/T_Neotropical_aves_pops.txt\t4\t0.387661234\t0.321131554\nexample_data/T_Neotropical_mammalia_pops.txt\t4\t0.127987201\t0.321131554\nexample_data/T_Neotropical_herps_pops.txt\t4\t0.484351565\t0.321131554\nexample_data/T_Nearctic_aves_pops.txt\t5\t0.376366476\t0.061683203\nexample_data/T_Nearctic_mammalia_pops.txt\t5\t0.249869859\t0.061683203\nexample_data/T_Nearctic_herps_pops.txt\t5\t0.373763665\t0.061683203\n```\n\nThis input file refers to 15 different population files, divided into 5 groups (in this case, biogeographic realms) using the \"Group\" column with different taxonomic groups within these. So group 1 is for the 'Afrotropical' realm and has three population files (Aves, Mammalia and Herps). Weightings are given for these taxonomic groups which specify how much weight each taxonomic group has within its realm index (the weights used here reflect the proportion of species in that taxonomic group in that realm). \n\n\n```{r terrestrial_lpi, eval=TRUE, message=FALSE}\n# Whole terrestrial...\n\n# Create a terrestrial index, without using any specified weightings ('use_weightings=0' - so treating taxonomic groups equally at one level, and biogeographic realms equally at the next)\nterr_lpi_a \u003c- LPIMain(\"example_data/terrestrial_infile.txt\", PLOT_MAX=2015, use_weightings=0, VERBOSE=FALSE, show_progress=FALSE)\n\n# Remove NAs (trailing years with no data)\nterr_lpi_a \u003c- terr_lpi_a[complete.cases(terr_lpi_a), ]\n\n# Run same again and now weight by class, but weight equally across realms (see infile for weights)\nterr_lpi_b \u003c- LPIMain(\"example_data/terrestrial_infile.txt\", PLOT_MAX=2015, force_recalculation=0, use_weightings=1, VERBOSE=FALSE, show_progress=FALSE)\n\n# Remove NAs (trailing years with no data)\nterr_lpi_b \u003c- terr_lpi_b[complete.cases(terr_lpi_b), ]\n\n# Putting the two LPIs together in a list\nlpis_comp \u003c- list(terr_lpi_a, terr_lpi_b)\n\n# And plotting them together \nggplot_multi_lpi(lpis_comp, xlims=c(1970, 2012), names=c(\"Unweighted\", \"Weighted\"), facet=TRUE)\n```\n\n## See Also - Creating infiles\n\nSome functions are also provided for creating infiles from tabular data: [Creating Infiles](creating_infiles.md)\n\n\n```\n```\n\n\n\n","funding_links":[],"readme_doi_urls":["https://dx.doi.org/10.6084/m9.figshare.4300022.v1"],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/325935","html_url":"https://ost.ecosyste.ms/projects/325935"}