Here’s another example of how we can use the PBDB to look at how bivalves have changed the depth of their burrowing over the Phanerozoic. We’re going to download data, and this time we’re adding some terms at the end, including ecospace. Once you download this data, take a look at it over in Environment so you can see the extra columns you’ve downloaded in addition to the regular occurrence data.

library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
bivalve_eco<-read.csv("https://paleobiodb.org/data1.2/occs/list.csv?base_name=Bivalvia&taxon_reso=family&interval=Devonian,Jurassic&show=class,ecospace,timebins")

Once you run this code yourself, make sure to click on the bivalve_eco Data over in Global Environment and see what it looks like. Scroll over to the right to see all the columns that you’ve downloaded.

So now we can look at how life habits have changed over time. One way to do this is to group by the max_ma of each occurrence, and then count how many life habit are in each category and each time bin.

bivalve_eco_summary<-bivalve_eco %>% group_by(max_ma)%>% dplyr::count(life_habit)

This is sort of hard to interpret, however, so we can use a plot to make it easier to see what’s going on. Here, I’ve done the same code as above, and then added a ggplot pipe to the end. My x axis is just max_ma, my y axis is the count of how many occurences are in each life habit, and I’ve color coded it by life habit so we can see all the different ones more clearly.

bivalve_eco_summary %>% ggplot(aes(x=max_ma, y=n, colour=life_habit))+geom_point()+scale_x_reverse()

This is cool, but there is still a lot to look at here and it’s hard to pull apart a single life habit. So we can do one more step, a filter, and specify the life habit we want to look at:

bivalve_eco_summary %>% filter(life_habit=="shallow infaunal") %>% ggplot(aes(x=max_ma, y=n, colour=life_habit))+geom_point()+scale_x_reverse()

Much nicer!!

This is just an example of the kinds of things we can do with the PBDB, so keep this in mind as you’re planning your final projects.

TO TURN IN:

Make one new figure using the bivalve_eco dataset that is different from the ones I’ve shown you how to make here. Submit the figure along with a caption for the figure that explains the figure and a brief summary of what you think the figure shows.