Skip to content

Commit 4ee0106

Browse files
Merge pull request #2 from NiklasHohmann/dev
Dev
2 parents 7237b5d + 4ed77b6 commit 4ee0106

5 files changed

Lines changed: 93 additions & 43 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
.Ruserdata
55

66
# don't track csv files
7-
*.csv
7+
*.csv
8+
*.pdf

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10782803.svg)](https://doi.org/10.5281/zenodo.10782803)
44

5-
Supplementary code for _"A revised marine fossil record of the Mediterranean before and after the Messinian Salinity Crisis"_. Generates summary statistics and maps.
5+
Supplementary code for _"A revised marine fossil record of the Mediterranean before and after the Messinian Salinity Crisis"_ (Agiadi et al 2024, [DOI: 10.5194/essd-2024-75](https://doi.org/10.5194/essd-2024-75)). Generates summary statistics, figures, and maps.
66

77
Project webpage: [REMARE project](https://sites.google.com/view/kagiadi/projects/remare)
88

@@ -51,7 +51,7 @@ source("code/download_data.R")
5151
to download the latest version of the database from Zenodo. Then, run
5252

5353
```R
54-
source("code/make_table.R")
54+
source("code/make_table_and_plots.R")
5555
```
5656

5757
in the console to produce the summary statistics of the database (stored in the variable `table`). You can view the values by running
@@ -60,12 +60,12 @@ in the console to produce the summary statistics of the database (stored in the
6060
table
6161
```
6262

63-
in the console. Details on producing the map are given in the file `code/make_maps.R`.
63+
in the console, and inspect the figures in `figs/`. Details on producing the map are given in the file `code/make_maps.R`.
6464

6565
## Repository structure
6666

6767
* _code_ : folder with R code
68-
* _make_table.R_ : script to generate table 1
68+
* _make_table_and_plots.R_ : script to generate table 1 and figures
6969
* _make_maps.R_ : script to generate the maps
7070
* _download_data.R_ : script to download data from Zenodo
7171
* _data_ : folder for raw data. Initially empty, will be filled with downloaded data after the script in `code/download_data.R` is run.
@@ -77,6 +77,13 @@ in the console. Details on producing the map are given in the file `code/make_ma
7777
* _README_ : README file
7878
* _renv.lock_ : lock file for `renv` package
7979

80+
## References
81+
82+
This repository downloads and uses data from
83+
84+
* Agiadi, K., Hohmann, N., Gliozzi, E., Thivaiou, D., Francesca, B., Taviani, M., Bianucci, G., Collareta, A., Londeix, L., Faranda, C., Bulian, F., Koskeridou, E., Lozar, F., Mancini, A. M., Dominici, S., Moissette, P., Bajo Campos, I., Borghi, E., Iliopoulos, G., … Garcia-Castellanos, D. (2024). Revised marine fossil record of the Mediterranean before and after the Messinian Salinity Crisis [Data set]. Zenodo. https://doi.org/10.5281/zenodo.13358435
85+
86+
8087
## Funding
8188

8289
This work was supported by the Austrian Science Fund (FWF) project “Late Miocene Mediterranean Marine Ecosystem Crisis” (2022–2026), Project no. V 986, [DOI 10.55776/V986](https://www.doi.org/10.55776/V986) (PI: K.Agiadi).

code/download_data.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# download latest version of the database from Zenodo, https://doi.org/10.5281/zenodo.12698765
33

44
cat("Downloading raw data\n")
5-
zen4R::download_zenodo("10.5281/zenodo.12698765", path = "data/")
5+
6+
zen4R::download_zenodo("10.5281/zenodo.13358435", path = "data/")
67

78
cat("Data successfully downloaded! \n")
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,40 @@ table["total", "families"] <- sum(table[group_names,"families"])
6464
table
6565

6666
cat("Table successfully generated!\n")
67+
68+
#### make plots ####
69+
library(ggplot2)
70+
cat("Creating plots\n")
71+
## plot occurrences
72+
make_occ_plot = function(file_name){
73+
df = data.frame(group = rep(group_names, each = 3),
74+
regions = rep(regions, length(group_names)),
75+
nocc = rep(NA, length(regions) * length(group_names)))
76+
for (i in seq_len(nrow(df))){
77+
df[i, "nocc"] = length(unique(messinian_db$ID[messinian_db$group.name == df$group[i] & messinian_db$region.new == df$regions[i]]))
78+
}
79+
ggplot(df, aes(x = group, fill = regions, y = nocc)) +
80+
geom_bar(stat = "identity", position = "dodge") +
81+
theme_classic()
82+
ggsave(file_name)
83+
}
84+
make_occ_plot("figs/occ.pdf")
85+
86+
make_loc_plot = function(file_name){
87+
df = data.frame(group = rep(group_names, each = 3),
88+
regions = rep(regions, length(group_names)),
89+
nloc = rep(NA, length(regions) * length(group_names)))
90+
for (i in seq_len(nrow(df))){
91+
df[i, "nloc"] = length(unique(messinian_db$Locality[messinian_db$group.name == df$group[i] & messinian_db$region.new == df$regions[i]]))
92+
}
93+
94+
ggplot(df, aes(x = group, y = nloc, fill = regions)) +
95+
geom_bar(position = position_dodge(), stat = "identity") +
96+
theme_classic()
97+
ggsave(file_name)
98+
}
99+
make_loc_plot("figs/locs.pdf")
100+
101+
102+
103+
cat("Plots are in figs/ \n")

renv.lock

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"R": {
3-
"Version": "4.3.2",
3+
"Version": "4.4.1",
44
"Repositories": [
55
{
66
"Name": "CRAN",
@@ -22,7 +22,7 @@
2222
},
2323
"MASS": {
2424
"Package": "MASS",
25-
"Version": "7.3-60",
25+
"Version": "7.3-61",
2626
"Source": "Repository",
2727
"Repository": "CRAN",
2828
"Requirements": [
@@ -33,11 +33,11 @@
3333
"stats",
3434
"utils"
3535
],
36-
"Hash": "a56a6365b3fa73293ea8d084be0d9bb0"
36+
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
3737
},
3838
"Matrix": {
3939
"Package": "Matrix",
40-
"Version": "1.6-4",
40+
"Version": "1.7-0",
4141
"Source": "Repository",
4242
"Repository": "CRAN",
4343
"Requirements": [
@@ -50,7 +50,7 @@
5050
"stats",
5151
"utils"
5252
],
53-
"Hash": "d9c655b30a2edc6bb2244c1d1e8d549d"
53+
"Hash": "1920b2f11133b12350024297d8a4ff4a"
5454
},
5555
"R6": {
5656
"Package": "R6",
@@ -74,14 +74,14 @@
7474
},
7575
"Rcpp": {
7676
"Package": "Rcpp",
77-
"Version": "1.0.12",
77+
"Version": "1.0.13",
7878
"Source": "Repository",
7979
"Repository": "CRAN",
8080
"Requirements": [
8181
"methods",
8282
"utils"
8383
],
84-
"Hash": "5ea2700d21e038ace58269ecdbeb9ec0"
84+
"Hash": "f27411eb6d9c3dada5edd444b8416675"
8585
},
8686
"XML": {
8787
"Package": "XML",
@@ -180,10 +180,10 @@
180180
},
181181
"bitops": {
182182
"Package": "bitops",
183-
"Version": "1.0-7",
183+
"Version": "1.0-8",
184184
"Source": "Repository",
185185
"Repository": "CRAN",
186-
"Hash": "b7d8d8ee39869c18d8846a184dd8a1af"
186+
"Hash": "da69e6b6f8feebec0827205aad3fdbd8"
187187
},
188188
"blob": {
189189
"Package": "blob",
@@ -226,7 +226,7 @@
226226
},
227227
"bslib": {
228228
"Package": "bslib",
229-
"Version": "0.7.0",
229+
"Version": "0.8.0",
230230
"Source": "Repository",
231231
"Repository": "CRAN",
232232
"Requirements": [
@@ -244,7 +244,7 @@
244244
"rlang",
245245
"sass"
246246
],
247-
"Hash": "8644cc53f43828f19133548195d7e59e"
247+
"Hash": "b299c6741ca9746fb227debcb0f9fb6c"
248248
},
249249
"cachem": {
250250
"Package": "cachem",
@@ -305,7 +305,7 @@
305305
},
306306
"colorspace": {
307307
"Package": "colorspace",
308-
"Version": "2.1-0",
308+
"Version": "2.1-1",
309309
"Source": "Repository",
310310
"Repository": "CRAN",
311311
"Requirements": [
@@ -315,7 +315,7 @@
315315
"methods",
316316
"stats"
317317
],
318-
"Hash": "f20c47fd52fae58b4e377c37bb8c335b"
318+
"Hash": "d954cb1c57e8d8b756165d7ba18aa55a"
319319
},
320320
"commonmark": {
321321
"Package": "commonmark",
@@ -423,14 +423,14 @@
423423
},
424424
"digest": {
425425
"Package": "digest",
426-
"Version": "0.6.36",
426+
"Version": "0.6.37",
427427
"Source": "Repository",
428428
"Repository": "CRAN",
429429
"Requirements": [
430430
"R",
431431
"utils"
432432
],
433-
"Hash": "fd6824ad91ede64151e93af67df6376b"
433+
"Hash": "33698c4b3127fc9f506654607fb73676"
434434
},
435435
"dplyr": {
436436
"Package": "dplyr",
@@ -1040,7 +1040,7 @@
10401040
},
10411041
"nlme": {
10421042
"Package": "nlme",
1043-
"Version": "3.1-165",
1043+
"Version": "3.1-166",
10441044
"Source": "Repository",
10451045
"Repository": "CRAN",
10461046
"Requirements": [
@@ -1050,17 +1050,17 @@
10501050
"stats",
10511051
"utils"
10521052
],
1053-
"Hash": "2769a88be217841b1f33ed469675c3cc"
1053+
"Hash": "ccbb8846be320b627e6aa2b4616a2ded"
10541054
},
10551055
"openssl": {
10561056
"Package": "openssl",
1057-
"Version": "2.2.0",
1057+
"Version": "2.2.1",
10581058
"Source": "Repository",
10591059
"Repository": "CRAN",
10601060
"Requirements": [
10611061
"askpass"
10621062
],
1063-
"Hash": "2bcca3848e4734eb3b16103bc9aa4b8e"
1063+
"Hash": "c62edf62de70cadf40553e10c739049d"
10641064
},
10651065
"pillar": {
10661066
"Package": "pillar",
@@ -1233,7 +1233,7 @@
12331233
},
12341234
"rdflib": {
12351235
"Package": "rdflib",
1236-
"Version": "0.2.8",
1236+
"Version": "0.2.9",
12371237
"Source": "Repository",
12381238
"Repository": "CRAN",
12391239
"Requirements": [
@@ -1245,7 +1245,7 @@
12451245
"tidyr",
12461246
"utils"
12471247
],
1248-
"Hash": "7aabe63f0e0a33190643e25ba9dd3774"
1248+
"Hash": "7d812c4fa75df359492a135421fa0c12"
12491249
},
12501250
"readr": {
12511251
"Package": "readr",
@@ -1317,9 +1317,12 @@
13171317
"renv": {
13181318
"Package": "renv",
13191319
"Version": "1.0.7",
1320-
"OS_type": null,
1321-
"Repository": "CRAN",
1322-
"Source": "Repository"
1320+
"Source": "Repository",
1321+
"Repository": "RSPM",
1322+
"Requirements": [
1323+
"utils"
1324+
],
1325+
"Hash": "397b7b2a265bc5a7a06852524dabae20"
13231326
},
13241327
"reprex": {
13251328
"Package": "reprex",
@@ -1356,7 +1359,7 @@
13561359
},
13571360
"rmarkdown": {
13581361
"Package": "rmarkdown",
1359-
"Version": "2.27",
1362+
"Version": "2.28",
13601363
"Source": "Repository",
13611364
"Repository": "CRAN",
13621365
"Requirements": [
@@ -1375,7 +1378,7 @@
13751378
"xfun",
13761379
"yaml"
13771380
],
1378-
"Hash": "27f9502e1cdbfa195f94e03b0f517484"
1381+
"Hash": "062470668513dcda416927085ee9bdc7"
13791382
},
13801383
"roxygen2": {
13811384
"Package": "roxygen2",
@@ -1666,13 +1669,13 @@
16661669
},
16671670
"tinytex": {
16681671
"Package": "tinytex",
1669-
"Version": "0.51",
1672+
"Version": "0.52",
16701673
"Source": "Repository",
16711674
"Repository": "CRAN",
16721675
"Requirements": [
16731676
"xfun"
16741677
],
1675-
"Hash": "d44e2fcd2e4e076f0aac540208559d1d"
1678+
"Hash": "cfbad971a71f0e27cec22e544a08bc3b"
16761679
},
16771680
"tzdb": {
16781681
"Package": "tzdb",
@@ -1697,13 +1700,13 @@
16971700
},
16981701
"uuid": {
16991702
"Package": "uuid",
1700-
"Version": "1.2-0",
1703+
"Version": "1.2-1",
17011704
"Source": "Repository",
17021705
"Repository": "CRAN",
17031706
"Requirements": [
17041707
"R"
17051708
],
1706-
"Hash": "303c19bfd970bece872f93a824e323d9"
1709+
"Hash": "34e965e62a41fcafb1ca60e9b142085b"
17071710
},
17081711
"vctrs": {
17091712
"Package": "vctrs",
@@ -1757,27 +1760,28 @@
17571760
},
17581761
"withr": {
17591762
"Package": "withr",
1760-
"Version": "3.0.0",
1763+
"Version": "3.0.1",
17611764
"Source": "Repository",
17621765
"Repository": "CRAN",
17631766
"Requirements": [
17641767
"R",
17651768
"grDevices",
17661769
"graphics"
17671770
],
1768-
"Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35"
1771+
"Hash": "07909200e8bbe90426fbfeb73e1e27aa"
17691772
},
17701773
"xfun": {
17711774
"Package": "xfun",
1772-
"Version": "0.45",
1775+
"Version": "0.47",
17731776
"Source": "Repository",
17741777
"Repository": "CRAN",
17751778
"Requirements": [
1779+
"R",
17761780
"grDevices",
17771781
"stats",
17781782
"tools"
17791783
],
1780-
"Hash": "ca59c87fe305b16a9141a5874c3a7889"
1784+
"Hash": "36ab21660e2d095fef0d83f689e0477c"
17811785
},
17821786
"xml2": {
17831787
"Package": "xml2",
@@ -1794,10 +1798,10 @@
17941798
},
17951799
"yaml": {
17961800
"Package": "yaml",
1797-
"Version": "2.3.9",
1801+
"Version": "2.3.10",
17981802
"Source": "Repository",
17991803
"Repository": "CRAN",
1800-
"Hash": "9cb28d11799d93c953f852083d55ee9e"
1804+
"Hash": "51dab85c6c98e50a18d7551e9d49f76c"
18011805
},
18021806
"zen4R": {
18031807
"Package": "zen4R",
@@ -1825,7 +1829,7 @@
18251829
"Package": "zip",
18261830
"Version": "2.3.1",
18271831
"Source": "Repository",
1828-
"Repository": "RSPM",
1832+
"Repository": "CRAN",
18291833
"Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab"
18301834
}
18311835
}

0 commit comments

Comments
 (0)