Reflecting on the complexitites of the natural world, John Muir once said, “When we try to pick out anything by itself, we find it hitched to everything else in the Universe.” Nowhere is this more true than in the ecology of what animals in an ecosystem eat. Each species has a distinguished pallet. Specialists are choosy, like the koala bear which subsists entirely on the leaves of the eucalyptus tree. Generalists, on the other hand, can eat whatever they like. Wild pigs, for instance, get by on get on a varied diet of nuts, mushrooms, snakes and carrion.
Understanding what different species in an ecosystem eat is a critically important research agenda because it informs how all the species in an ecosystem contribute to that ecosystem’s function. Comprehensive knowledge of food webs can also allow researchers to make better-informed conservation decisions. For example, if we know that a particular mouse species in an alpine forest is eaten by nearly every predator in the landscape, then focusing on protecting that mouse might be a particularly good use of conservation resources, as the survival of that species is linked to so many other species.
Traditionally, observations of what an animal eats are reported in small scientific journals with limited readership. To my knowledge, there is currently no central hub of feeding ecology, where researchers can search for an animal species of interest and find a list of all the documented plants, fungi and animals known to be eaten by that animal. To remedy this, earlier this year I started a project meant to collect and document observations of animal feeding ecology in order to begin building a searchable database of predation and herbivory. While this project is still being developed, I would like to use my efforts for this class project to outline how I would go about analyzing the data that will be available in my project, using a dataset of animal interactions on “iNaturalist”. iNaturalist is a global repository of observations of wildlife. Anyone can submit data to iNaturalist by uploading photos of animals, plants and fungi they see using the iNaturalist mobile app. These volunteers work together to identify the species in the uploaded photos, and observations can be grouped into volunteer-run “projects” within the iNaturalist web page.
One such project is called “Interactions s Afr”. The purpose of this project is to collect any observations of animals interacting (fighting, mating, eating one another, etc.) seen in the region of Southern Africa. Currently, there are nearly 30,000 observations of animal interactions submitted to the project since it started in 2017. My goal is to filter the dataset down to high-quality observations of animals feeding on other species and then build a food web for the region of Southern Africa based on these data. This analysis will help answer the question: how are species connected in Southern Africa through a region-wide food web? This project will also guide my thinking on how to build a global version of such a dataset in the future.
I downloaded a CSV of all 28,000 observations of animal interactions from the iNaturalist project page for Interactions s Afr. This dataset contains rows of observations of an individual plant, animal or fungus. Each observation contains a unique identifier for the observation, data about the date and time of the observation, the username of the volunteer that submitted the observation, whether or not the observation is “research-grade” (i.e., whether a consensus has been reached among at least two volunteers on the identity of the species in the photo(s)), the location of the observation, and the taxa observed. Additionally, a final variable, “field:eating:(interaction)” contains a link to a different observation in the dataset if that observation is of an “eating” interaction (as mentioned above, there were other fields for other forms of interaction such as fighting; I did not download the variables for these other fields). Using this final variable and the unique identifier for each observation, I will be able to “link” an observation of an “eater” and the animal/plant/fungus being eaten in order to build my food web. For the purposes of this class project, these food webs will serve as my advanced data analysis models (they were really hard to make!).
All data in this dataset are from volunteers that submitted photos of wildlife interactions they saw in Southern Africa. Below, I summarize the most important variables in the dataset to give a sense for the kinds of observations included.
| Variable | Definition | Units or data format |
|---|---|---|
| observed_on | Date the observation was made | month-day-year format |
| quality_grade | Measure of confidence of the quality of the species identification. I will only keep data at the ‘research-grade’ level, which denotes observations where two or more people on iNaturalist agree that the species has been properly identified | casual, needs_id, or research |
| url | The web URL on iNaturalist where you can find the observation. Also functions as a unique identifier for each observation in the dataset | NA |
| scientific_name | The Latin name of the species in the observation | NA |
| iconic_taxon_name | Higher-level taxonomic identification of the observation | Actinopterygii, Amphibia, Animalia, Arachnida, Aves, Chromista, Fungi, Insecta, Mammalia, Mollusca, Plantae, Protozoa, Reptilia, or NA |
| latitude | The latitude where the observation was made | Degrees |
| longitude | The longitude where the observation was made | Degrees |
| field:eating: (interaction) | Only filled in if the observation is of an animal eating a plant animal or fungus. Data in this variable are URLs to the observation ‘partner,’ that is, the observation of the individual plant/animal/fungus being eaten or the animal doing the eating. Each observation of ‘eating’ should have two observations in this dataset: the ‘eater’ and the thing being eaten | URL |
My primary goal for this project is to build an interactive food web of Southern Africa to see which species are most connected to which other species in the web. However, before I can conduct my analyses, I need to tidy and wrangle my data, which are currently rather messy and include a lot of observations not relevant to my research question. After that I will compute summary statistics to explore the observations in my data. Last, I will create the network.
I first need to trim these data down to only those observations that are “research” grade in order to ensure data quality. As outlined above, research grade observations are those for which at least two iNaturalist volunteers agree that the observation has been correctly identified. The second main step in my data tidying will be excluding any observation that does not have a matching “partner” observation in the dataset. In essence, to create the food web I need two observations in the dataset for every instance of predation or herbivory– the individual being eaten and the individual doing the eating! Some observations in this dataset are noted as being an observation of predation/herbivory but only one partner in this interaction has been submitted as an observation to the project. Without the “partner” observation, I can’t verify what the species is that was being eaten or doing the eating in the interaction. This will be the most complicated step, as I will need to match the unique URL identifier for both partners in the interaction and then exclude all observations without a matching partner. I include the code used below to illustrate how I wrangled the data in my dataset (called snacks in my code).
## EXCLUDE NON-RESEARCH GRADE OBSERVATIONS
tidy_snacks <- snacks %>%
filter(quality_grade == "research")
## PAIR EATER AND THING BEING EATEN IN ONE DATAFRAME
identifier_species <- tidy_snacks %>%
dplyr::select(id, scientific_name, common_name, iconic_taxon_name) %>%
rename(inter = id, prey_sci_name = scientific_name, prey_common_name = common_name, prey_taxon_name = iconic_taxon_name) %>%
mutate(inter = as.character(inter))
tidier_snacks <- tidy_snacks %>%
separate(`field:eating: (interaction)`, into = c("inter1", "inter2"), sep = "; |, ") %>%
mutate(inter1 = gsub(".*https://www.inaturalist.org/observations/","",inter1),
inter2 = gsub(".*https://www.inaturalist.org/observations/","",inter2)) %>%
pivot_longer(inter1:inter2, names_to = "scratch", values_to = "inter") %>%
left_join(identifier_species) %>%
drop_na(prey_sci_name)
Now that the data have been tidied in the dataframe tidier_snacks I will compute summary statistics for the variables of interest. These variables include the date the observations were made, the species doing the eating, the species getting eaten, and the location of the observations. To stay within the bounds of the number of figures allowed for this assignment, I only include the map of feeding observations below.
The last step in my data analysis is to build an interaction network showing what the different animals in this dataset are eating. This network will essentially take the form of a food web, a means of understanding feeding interactions in an ecosystem that most people were introduced to in a high school biology class. While food webs are a basic means of visualizing which species are eating which other species, they can reveal surprising trends when they make use of hundreds of different data points, as my network below will show. I will use the networkD3 package, which I found through a Google search, to build this network. This package is particularly useful because it allows me to make the network highly interactive– even allowing you to pluck out one of the nodes and move it around in a manner reminiscent of the John Muir quote referenced in the introduction. Below, I build two different networks to visualize the food web in the data. The first network shows all the species interactions, the second bins the species into higher-order taxa (reptiles, birds, etc.) and shows the coarse relationships among the plants, animals and fungi in this dataset. I also create a Sankey Network, as a different means of visualizing the relationship among the taxa in this dataset. Lastly, I create a table of the feeding interactions among higher-order taxa.
Figure 2: Food Web of Southern Africa
Figure 3: Higher-Level Food Web of Southern Africa
Figure 4: Sankey Diagram Illustrating Feeding Interactions
| Eater Taxon Name | Food Taxon Name | Count |
|---|---|---|
| Insecta | Plantae | 225 |
| Aves | Plantae | 124 |
| Mammalia | Plantae | 44 |
| Insecta | Insecta | 37 |
| Aves | Actinopterygii | 29 |
| Aves | Insecta | 29 |
| Aves | Reptilia | 27 |
| Aves | Mammalia | 21 |
| Aves | Aves | 19 |
| Reptilia | Reptilia | 18 |
| Mammalia | Mammalia | 16 |
| Aves | Amphibia | 12 |
| Arachnida | Insecta | 11 |
| Insecta | Mammalia | 10 |
| Plantae | Insecta | 8 |
| Reptilia | Amphibia | 8 |
| Reptilia | Aves | 7 |
| Insecta | Reptilia | 6 |
| Mammalia | Aves | 5 |
| Reptilia | Insecta | 5 |
| Insecta | Aves | 4 |
| Insecta | Amphibia | 2 |
| Mammalia | Insecta | 2 |
| Mollusca | Plantae | 2 |
| Reptilia | Mammalia | 2 |
| Reptilia | Plantae | 2 |
| Amphibia | Aves | 1 |
| Animalia | Animalia | 1 |
| Animalia | Mammalia | 1 |
| Arachnida | Reptilia | 1 |
| Aves | Animalia | 1 |
| Aves | Mollusca | 1 |
| Fungi | Plantae | 1 |
| Mammalia | Amphibia | 1 |
| Mammalia | Mollusca | 1 |
| Mammalia | Reptilia | 1 |
| Mollusca | Mammalia | 1 |
| Mollusca | Mollusca | 1 |
| Plantae | Mammalia | 1 |
| Plantae | Plantae | 1 |
I used hundreds of volunteer-submitted observations of plants, animals and fungi to build a network of feeding ecology across the region of Southern Africa. In total, I found almost 700 verifiable observations of animals feeding on plants, fungi or other animals in this dataset, spread out across all of Southern Africa but concentrated most heavily in South Africa (Figure 1). The majority of observations of animal feeding were of birds and insects eating plants (Table 2, Figures 3 & 4). In the finer-level food web, I found one central network of the more commonly observed species – again mostly insects, plants and birds (Figure 2). However, many of the nodes in the data were outside of this central network, often connected in groups of just two or three. This tells me that this network is likely incomplete, since very few species of animal actually eat only one or two other species. This is to be expected, since this project on iNaturalist is only a few years old, volunteers casually making observations of feeding in the wild is rare, and the region of Southern Africa is home to many thousands of different species. I was actually quite pleased that this model showed the dense connections that it did (in some parts of the network) given these constraints.
There were also a few surprises. In examining Figure 2, an interaction caught my eye where it appeared an insect was eating a bird. Suspecting there was some kind of error, I went back to the original dataset and found a hyperlink to the observation. It turned out there was no error; it was simply ants eating what appeared to be a bird that was already dead. Future iterations of this project should attempt to categorize node edges in the network according to whether the interaction is predation, herbivory, cannibalism, or scavenging and then use these categorizations to better understand how these different forms of feeding are distributed in the network and in the ecosystem.
This project demonstrates the power of volunteer-collected citizen science data, the primary focus of my dissertation (not food web networks, though now I’m getting pretty intrigued with the idea…). With very little effort, the managers that run the “Interactions s Afr” project on iNaturalist have collected nearly 30,000 observations of wildlife in Southern Africa from hundreds of volunteer contributors. I was able to mine these observations to answer a specific research question from a small subset of these data: verifiable observations of animal feeding. While, for a reserach paper, I would want to double-check the data quality of these observations, doing so wouldn’t take more than a week of steady work. This is far less effort than going out into the field across Southern Africa to try to document nearly 700 instances of animal feeding!
This project also demonstrates the interconnected and complex nature of ecosystems. Understanding feeding ecology is a critical step towards better understanding ecosystem function, and I believe the results of even this preliminary study could inform deeper understandings of what keystone species may be centralized in the network and thereby of particular conservation importance to this region. Returning to the guiding question from the introduction, it appears that some species in this region are highly interconnected in the food web and some are more peripheral, though some of these differences may be due to the limited sample of observations in this dataset. For instance, the most highly-connected species in the network is the Four-striped grass mouse (rhabdomys pumilio), which is connected to at least eight other species in this ecosystem. Given this, if I were a conservation biologist working in this region and didn’t know very much about this species, I would want to use my resources to better understand whether this species is declining.
Finally, these results could form the basis of a larger network of feeding ecology around the world, something I am interested in pursuing. There is, as yet, no real central database of which species are known to eat which other species. Instead, these findings tend to be reported one at a time in niche, taxa-specific journals. Going forward, I think it would be important to create such a hub, drawing on both citizen science data and existing data from the literature. In my view, a critical piece of such a database would be a public-facing network similar to the ones I made for this assignment, which shows the interconnections of the species at a global website. Such a network would be incredibly complex, and as a strategy for conservation communication, I think that would sort of be the point. As Muir said, when we tug at one thing in nature, we find it connected to the rest of the world. This would quite literally be true on such an interactive network. And this network would, perhaps, reinforce conservation messaging around the importance of humility when considering human impacts; with such a complex ecology surrounding us, it’s important to be conservative about how we impact that ecosystem, because we really do have a limited understanding of our potential impact.