This R Markdown document accompanies the course LCF5900 – Reproducible and Open Processing of Scientific Data (2026) and demonstrates how to incorporate openly shared data and code into a transparent workflow. The example selected comes from Banks‑Leite, C.; Ewers, R. M.; Metzger, J. P. (2012) titled Unraveling the drivers of community dissimilarity and species extinction in fragmented landscapes published in Ecology.
This study was chosen because it exemplifies good practices in open data and code sharing in landscape ecology. Following the principles of scientific reproducibility advocated by Scientific Data and Springer Nature, the authors provide their raw data, R scripts, and auxiliary functions necessary to reproduce the analyses.
The repository includes:
The article investigates how biological communities change across fragmented landscapes. Traditional fragmentation studies rely on the Species–Area Relationship (SAR), which assumes that habitat loss causes species extinctions. However, disturbance‑tolerant species may colonize degraded habitats, offsetting extinctions. To examine these dynamics, the authors analysed 140 bird species sampled in 65 forest patches within six Atlantic‑Forest landscapes exhibiting varying amounts of forest cover.
Empirical results were compared against simulations of over eight million ecological communities. These simulations contrasted models driven by SAR against models driven by species turnover. The findings showed that composition was strongly affected by habitat loss at both patch and landscape scales, whereas total species richness changed little. Replacement of forest‑dependent species by disturbance‑tolerant species explained the observed patterns better than SAR alone. Consequently, species richness is a poor proxy for assessing ecological responses to fragmentation.
The study demonstrates that significant shifts in community composition can occur without pronounced declines in species richness, highlighting the importance of species turnover and species‑specific extinction thresholds in landscape ecology. As an example of open science, it provides the data and code necessary to replicate the analyses, supporting transparency and reproducibility.
In this section we illustrate how to fetch and inspect data stored in
a GitHub repository. The repository
Open‑Science---Figshare‑exercise contains the explanatory
text summarizing the selected article. Below we download the README file
directly from GitHub and display its contents.
# Load necessary packages
library(httr)
# Define the URL to the raw README file in the GitHub repository
readme_url <- "https://raw.githubusercontent.com/jomilc/Open-Science---Figshare-exercise/main/README.md"
# Download the README content
resp <- httr::GET(readme_url)
if (httr::status_code(resp) == 200) {
readme_text <- httr::content(resp, as = "text", encoding = "UTF-8")
# Print the first few lines of the README
cat(paste(head(strsplit(readme_text, "\n")[[1]], 15), collapse = "\n"))
} else {
cat("Failed to retrieve README.md from GitHub")
}
## # Open-Science - Figshare-exercise
##
## Selected Article for Open Science Exercise and Reproducibility Assessment
## LCF5900 - Reproducible and Open Processing of Scientific Data (2026)
##
## As an example of data and code sharing in Landscape Ecology, the following article was selected:
##
## Banks-Leite, C.; Ewers, R. M.; Metzger, J. P. (2012). Unraveling the drivers of community dissimilarity and species extinction in fragmented landscapes. Ecology, 93(12), 2560–2569.
##
## DOI: 10.1890/11-2054.1
##
## Scientific article: Unraveling the drivers of community dissimilarity and species extinction in fragmented landscapes
##
## Data and code repository (Figshare): Supplement 1 – Data and R source code
The code chunk above downloads the README file from GitHub via the
httr package and prints the first 15 lines. You can adapt
this approach to retrieve data files (e.g., .csv,
.tsv) stored in a repository by replacing
readme_url with the appropriate raw file URL. Once data are
read into R, you can perform exploratory analyses, visualize them, and
reproduce the results described in the article.
This R Markdown document illustrates how to incorporate information from a GitHub repository into a reproducible workflow. By coupling narrative text describing the scientific study with code that fetches data from open repositories, we adhere to principles of open science and reproducibility. You can extend this template by adding additional code chunks to process and analyze the actual bird community data provided in the Figshare repository once the data files are downloaded locally or accessed via raw URLs.