Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHohmann authored Aug 22, 2024
2 parents 0c180c7 + 7237b5d commit 4ed77b6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ in the console, and inspect the figures in `figs/`. Details on producing the map
* _make_table_and_plots.R_ : script to generate table 1 and figures
* _make_maps.R_ : script to generate the maps
* _download_data.R_ : script to download data from Zenodo
* _data_ : folder for raw data. Initially empty, will be filled with downloaded data after the script in `code/download_data` is run.
* _data_ : folder for raw data. Initially empty, will be filled with downloaded data after the script in `code/download_data.R` is run.
* _figs_ : folder for figures. Initially empty
* _renv_ : folder used by the `renv` package
* _.gitignore_ : untracked files
Expand Down
3 changes: 2 additions & 1 deletion code/download_data.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#### download data from Zenodo ####
# download latest version of the database from Zenodo, https://zenodo.org/doi/10.5281/zenodo.10782428
# download latest version of the database from Zenodo, https://doi.org/10.5281/zenodo.12698765

cat("Downloading raw data\n")

zen4R::download_zenodo("10.5281/zenodo.13358435", path = "data/")

cat("Data successfully downloaded! \n")
46 changes: 23 additions & 23 deletions code/make_maps.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class(coord)
qmplot(lon,lat,data=coord,maptype="stamen_toner_lite",color=I("red"))
# OR
ggmap(Med_map)+geom_point(data=coord,aes(color="darkred",shape=Age))
ggsave("dataset_map.pdf",width=9,height=5)
ggsave("figs/maps/dataset_map.pdf",width=9,height=5)

# Color by stage
Tortonian<-filter(coord,Age=="Tortonian")
Messinian<-filter(coord,Age=="pre-evaporitic Messinian")
Zanclean<-filter(coord,Age=="Zanclean")
ggmap(Med_map)+geom_point(data=Tortonian,color="darkblue")+geom_point(data=Messinian,color="darkred")+geom_point(data=Zanclean,color="gold2")
ggsave("locs_by_stage_map.pdf",width=9,height=5)
ggsave("figs/maps/locs_by_stage_map.pdf",width=9,height=5)

# Color by region
wMed<-filter(coord,region=="Western Mediterranean")
eMed<-filter(coord,region=="Eastern Mediterranean")
PoA<-filter(coord,region=="Po Plain-Northern Adriatic")
ggmap(Med_map)+geom_point(data=wMed,color="green4")+geom_point(data=eMed,color="pink4")+geom_point(data=PoA,color="orange3")
ggsave("locs_by_region_map.pdf",width=9,height=5)
ggsave("figs/maps/locs_by_region_map.pdf",width=9,height=5)

# Color by stage and region
ggmap(Med_map)+
Expand All @@ -50,7 +50,7 @@ ggmap(Med_map)+
labs(x="longitude",y="latitude")+
theme(legend.position="bottom")

ggsave("stage_region_map2.pdf",width=9,height=5)
ggsave("figs/maps/stage_region_map2.pdf",width=9,height=5)

# plot for each group separately
tax_groups<-unique(coord$group.name)
Expand All @@ -70,56 +70,56 @@ bryo<-filter(coord,group.name=="bryozoans")
othermolluscs<-filter(coord, group.name=="scaphopod_chitons_cephalopods")

ggmap(Med_map)+geom_point(data=pforams,aes(color=Age))
ggsave("pforams.pdf",width=9,height=5)
ggsave("figs/maps/pforams.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=nano,aes(color=Age))
ggsave("nano.pdf",width=9,height=5)
ggsave("figs/maps/nano.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=ostracods,aes(color=Age))
ggsave("ostracods.pdf",width=9,height=5)
ggsave("figs/maps/ostracods.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=bforams,aes(color=Age))
ggsave("bforams.pdf",width=9,height=5)
ggsave("figs/maps/bforams.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=gastr,aes(color=Age))
ggsave("gastro.pdf",width=9,height=5)
ggsave("figs/maps/gastro.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=echinoids,aes(color=Age))
ggsave("echinoids.pdf",width=9,height=5)
ggsave("figs/maps/echinoids.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=fish,aes(color=Age))
ggsave("fish.pdf",width=9,height=5)
ggsave("figs/maps/fish.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=mmammals,aes(color=Age))
ggsave("marine_mammals.pdf",width=9,height=5)
ggsave("figs/maps/marine_mammals.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=biv,aes(color=Age))
ggsave("bivalves.pdf",width=9,height=5)
ggsave("figs/maps/bivalves.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=corals,aes(color=Age))
ggsave("corals.pdf",width=9,height=5)
ggsave("figs/maps/corals.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=dino,aes(color=Age))
ggsave("dino.pdf",width=9,height=5)
ggsave("figs/maps/dino.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=sharks,aes(color=Age))
ggsave("sharks.pdf",width=9,height=5)
ggsave("figs/maps/sharks.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=bryo,aes(color=Age))
ggsave("bryo.pdf",width=9,height=5)
ggsave("figs/maps/bryo.pdf",width=9,height=5)

ggmap(Med_map)+geom_point(data=othermolluscs,aes(color=Age))
ggsave("othermolluscs.pdf",width=9,height=5)
ggsave("figs/maps/othermolluscs.pdf",width=9,height=5)

# plot groups split into plankton, benthos, necton and large marine vertebrates
# plankton: planktic_foraminifera, nanoplankton, dinocysts
# benthos: benthic_foraminifera, bryozoans, molluscs, echinoids, corals
# necton: fish, ostracods
# benthos: benthic_foraminifera, ostracods, bryozoans, molluscs, echinoids, corals
# necton: fish
# large marine vertebrates: sharks, marine mammals
plankton<-rbind(pforams,nano,dino)
benthos<-rbind(bforams,bryo,othermolluscs,gastr,biv,echinoids,corals)
necton<-rbind(fish,ostracods)
benthos<-rbind(bforams,ostracods,bryo,othermolluscs,gastr,biv,echinoids,corals)
necton<-rbind(fish)
large_mar_vert<-rbind(sharks,mmammals)

ggmap(Med_map)+geom_point(data=plankton,color="gold1",aes(shape=Age))+geom_point(data=benthos,color="red",aes(shape=Age))+geom_point(data=necton,color="blue",aes(shape=Age))+geom_point(data=large_mar_vert,color="green",aes(shape=Age))
ggsave("fgroups.pdf",width=9,height=5)
ggsave("figs/maps/fgroups.pdf",width=9,height=5)
Empty file added figs/maps/.gitkeep.txt
Empty file.

0 comments on commit 4ed77b6

Please sign in to comment.