Skip to content

Commit

Permalink
updating scripts and readme, deleting unnecessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
johannabosch committed Aug 19, 2024
1 parent e2ca42c commit 0bf4630
Show file tree
Hide file tree
Showing 53 changed files with 765 additions and 4,973 deletions.
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,55 @@
## **Paleoecological Analysis in R**
# **Paleoecological Analysis in R**



|Open the Gitbook to get started: [johannabosch/Paleoecological Analysis in R](https://johannabosch.github.io/Paleolimnological_Analysis_in_R/)|
|--|
|This is a tutorial-based review of the analysis from Bosch et al. 2024 (see below), hosted by Github pages. It includes a total of 5 chapters, each pertaining to a specific analysis conducted in R using the data found in this repository|

### Study overview
## Study overview

This is a public repo that can be used to learn how to conduct a paleoecological analysis in R. The project methods described here are formally reviewed and cited in the following paper. Please use this citation to cite this repository:

Bosch J, Álvarez-Manzaneda I, Smol J, Michelutti N, Robertson GJ, Wilhelm SI, Montevecchi WA. 2024 Blending census and paleolimnological data allows for tracking the establishment and growth of a major gannet colony over several centuries. Proceedings of the Royal Society B [in review].


### Accessing the data
## Accessing the data

A list of each of the data files from the `/data` folder and their contents:

* `FileS1_ColonialSeabirdDatabase_WilhelmSI.csv` : Historical population reports collected for seabird species nesting in Cape St. Mary’s Ecological Reserve from 1883-2018. A blank cell indicates that population counts were not collected for that year.

| File name | Descriptions |
|----|---|
|`FileS1_ColonialSeabirdDatabase_WilhelmSI.csv`| Historical population reports collected for seabird species nesting in Cape St. Mary’s Ecological Reserve from 1883-2018. A blank cell indicates that population counts were not collected for that year. |
|`FileS2_MonitoringData.csv`|Raw monitoring data from File S1 used to align population data to the proxies.|
|`FileS3_Dating_CSM-IMP.csv` and `File S4_Dating_CSM-REF.csv`| Table containing 210Pb dating profiles over the depth of the impact core (CSM-IMP) and reference core (CSM-REF).|
|`FileS5_ProxyData_CSM-IMP.csv` and `FileS6_ProxyData_CSM-REF.csv`| Table containing the isotope, metal(loid), chlorophyll a, and diatom count data for the depths of the sediment core collected from the reference pond.|
|`File S7_Metalloids_CSM-IMP.csv` and `File S8_Metalloids_CSM-REF.csv`|Table of all metal(loid)s analyzed for the impact core and reference core.|
|`FileS9_ZScores_CSM-IMP.csv` | Z-score data for the isotope, metal(loid)s, chlorophyll a, and diatom count for the depths of the sediment core collected from the impact pond.|


* `FileS2_MonitoringData.csv` : Raw monitoring data from File S1 used to align population data to the proxies.
## Scripts and Figures

Here is a description of all the scripts used in this analysis (see `/scripts`) and the final figures produced by each script.

* `FileS3_Dating_CSM-IMP.csv` and `File S4_Dating_CSM-REF.csv` : Table containing 210Pb dating profiles over the depth of the impact core (CSM-IMP) and reference core (CSM-REF).
### **Proxy Alignment with Population Data**
- **Script:** See `scripts/Z_score_analysis.R`
![Proxy Alignment with Population Data](figs/proxy_alignment_populations.png)

### **Broken Stick Analysis for Metals**
- **Script:** See `scripts/breakpoint_analysis_metals.R`
![Broken Stick Analysis for Metals](figs/broken_stick_metals.png)

* `FileS5_ProxyData_CSM-IMP.csv` and `FileS6_ProxyData_CSM-REF.csv` : Table containing the isotope, metal(loid), chlorophyll a, and diatom count data for the depths of the sediment core collected from the reference pond.
### **Core Activity**
- **Script:** See `scripts/dating_profiles.R`
![Core Activity](figs/core_activity.png)

### **Core Age Model**
- **Script:** See `scripts/dating_profiles.R`
![Core Age Model](figs/core_age.png)

* `File S7_Metalloids_CSM-IMP.csv` and `File S8_Metalloids_CSM-REF.csv` : Table of all metal(loid)s analyzed for the impact core and reference core.
### **GAM Depth Plot**
- **Script:** See `scripts/GAM_depth.R`
![GAM Depth Plot](figs/GAM_depth.png)

### **Nested Metals Plot**
- **Script:** See `scripts/breakpoint_analysis_metals.R`
![Nested Metals Plot](figs/nested_metals.png)

* `FileS9_ZScores_CSM-IMP.csv` : Z-score data for the isotope, metal(loid)s, chlorophyll a, and diatom count for the depths of the sediment core collected from the impact pond.
### **Paleostratigraphies**
- **Script:** See `scripts/paleostratigraphies.R`
![Paleostratigraphies](figs/paleostratigraphies.png)
2 changes: 1 addition & 1 deletion data/FileS4_Dating_CSM-REF.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
midpoint,Total 210Pb_activity (Bq/kg),Error Total 210Pb_activity (Bq/kg),Sed. Rate (cm/y),Error Sed. Rate (cm/y),Year (CRS),Age (CRS),Error (CRS)
depth,Total 210Pb_activity (Bq/kg),Error Total 210Pb_activity (Bq/kg),Sed. Rate (cm/y),Error Sed. Rate (cm/y),Year (CRS),Age (CRS),Error (CRS)
0,,,,,2021.68,0,0
0.25,572.38,39.95,0.0359,0.003,2015.39,6.3,0.68
0.75,644.69,39.98,0.019,0.0016,1996.48,25.21,1.89
Expand Down
166 changes: 83 additions & 83 deletions data/FileS5_ProxyData_CSM-IMP.csv
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
midpoint,chla,Al,P,Zn,Cd,d15N,d13C,S.cons,S.exi
0.125,0.145270351,,,,,,,99.36170213,0
0.375,0.137215245,9700,8700,100,2,,,,
0.625,0.114581613,,,,,10.91,-27.05,,
0.875,0.125933135,,,,,,,,
1.125,0.10597335,,,,,,,98.9626556,0.829875519
1.375,0.095384889,12000,8600,140,2.6,,,,
1.625,0.098482268,,,,,10.52,-27.24,,
1.875,0.101783636,,,,,,,,
2.125,0.11823101,,,,,,,98.43400447,1.342281879
2.375,0.113150233,11000,9100,140,2.6,,,,
2.625,0.127812676,,,,,10.97,-26.65,,
2.875,0.122760865,,,,,,,,
3.125,0.10051457,,,,,,,99.5584989,0
3.375,0.110048778,12000,9400,140,2.5,,,,
3.625,0.095809123,,,,,10.81,-26.68,,
3.875,0.078333919,,,,,,,,
4.125,0.089725407,,,,,,,96.98681733,1.506591337
4.375,0.092749386,12000,9300,140,2.4,,,,
4.625,0.063825771,,,,,9.88,-26.87,,
4.875,0.066423368,,,,,,,,
5.125,0.057837761,,,,,,,99.19224556,0
5.375,0.038124295,7600,1900,70,0.69,,,,
5.625,0.021130601,,,,,6.6,-27.14,,
5.875,0.018618849,,,,,,,,
6.125,0.019621569,,,,,,,91.92825112,7.623318386
6.375,0.012173345,7500,1900,57,0.61,,,,
6.625,0.011422115,,,,,2.03,-26.84,,
6.875,0.012290873,,,,,,,,
7.125,0.009889201,,,,,,,67.32673267,30.44554455
7.375,0.010313611,8300,1900,46,0.55,,,,
7.625,0.008518601,,,,,1.56,-26.63,,
7.875,0.008423684,,,,,,,,
8.125,0.008307514,,,,,,,48.26789838,45.72748268
8.375,0.008086348,7700,1500,28,0.39,,,,
8.625,0.007920309,,,,,1.31,-26.66,,
8.875,0.008470573,,,,,,,,
9.125,0.009500857,,,,,1.1,-26.57,63.57466063,34.61538462
9.375,0.008822984,8200,1500,27,0.42,,,,
9.625,0.008322194,,,,,,,,
9.875,0.007737618,,,,,,,,
10.125,0.009139681,,,,,1.19,-26.66,38.18181818,60.77922078
10.375,0.008866411,7300,1000,22,0.36,,,,
10.625,0.009233503,,,,,,,,
10.875,0.009553048,,,,,,,,
11.125,0.008989856,,,,,0.63,-26.51,48.8700565,51.1299435
11.375,0.00830988,6500,970,17,0.34,,,,
11.625,0.007843139,,,,,,,,
11.875,0.008911591,,,,,,,,
12.125,0.006402951,,,,,0.59,-26.53,36.99059561,62.69592476
12.375,0.007844279,4500,700,11,0.25,,,,
12.625,0.006342522,,,,,,,,
12.875,0.00582727,,,,,,,,
13.125,0.004688441,,,,,1.02,-26.76,38.56041131,59.89717224
13.375,0.005974773,3900,590,8.8,0.23,,,,
13.625,0.006078542,,,,,,,,
13.875,0.005798085,,,,,,,,
14.125,0.005294491,,,,,0.88,-26.9,26.83615819,71.18644068
14.375,0.006329112,3800,560,7.4,0.16,,,,
14.625,0.005333492,,,,,,,,
14.875,0.005979681,,,,,,,,
15.25,0.00732149,,,,,0.16,-26.75,26.39296188,71.5542522
15.75,0.005624772,,,,,,,,
16.25,0.005426568,,,,,0.79,-26.85,93.33333333,4.761904762
16.75,0.004616399,,,,,,,,
17.25,0.005131782,,,,,1.46,-27.29,,
17.75,0.006898658,,,,,,,,
18.25,0.006522627,,,,,1.36,-26.71,,
18.75,0.005801503,,,,,,,,
19.25,0.006620656,,,,,1.81,-27.27,,
19.75,0.004970344,,,,,,,,
20.25,0.005253386,,,,,1.49,-26.56,,
20.75,0.005709259,,,,,,,,
21.25,0.005876788,,,,,1.81,-27.24,,
21.75,0.005570214,,,,,,,,
22.25,0.005648216,,,,,0.2,-26.37,,
22.75,0.005321178,,,,,,,,
23.25,0.005717279,,,,,1.15,-27.29,,
23.75,0.004890984,,,,,,,,
24.25,0.004610089,,,,,1.05,-27.25,,
24.75,0.004503866,,,,,,,,
25.25,0.004808118,,,,,1.22,-27.28,,
25.75,0.004901238,,,,,,,,
midpoint,year,chla,Al,P,Zn,Cd,d15N,d13C,S.cons,S.exi
0.125,2021.04,0.145270351,,,,,,,99.36170213,0
0.375,2019.42,0.137215245,9700,8700,100,2,,,,
0.625,2017.8,0.114581613,,,,,10.91,-27.05,,
0.875,2016.17,0.125933135,,,,,,,,
1.125,2014.55,0.10597335,,,,,,,98.9626556,0.829875519
1.375,2012.22,0.095384889,12000,8600,140,2.6,,,,
1.625,2009.89,0.098482268,,,,,10.52,-27.24,,
1.875,2007.56,0.101783636,,,,,,,,
2.125,2005.23,0.11823101,,,,,,,98.43400447,1.342281879
2.375,2003.23,0.113150233,11000,9100,140,2.6,,,,
2.625,2001.22,0.127812676,,,,,10.97,-26.65,,
2.875,1999.22,0.122760865,,,,,,,,
3.125,1997.21,0.10051457,,,,,,,99.5584989,0
3.375,1994.62,0.110048778,12000,9400,140,2.5,,,,
3.625,1992.03,0.095809123,,,,,10.81,-26.68,,
3.875,1989.43,0.078333919,,,,,,,,
4.125,1986.84,0.089725407,,,,,,,96.98681733,1.506591337
4.375,1981.23,0.092749386,12000,9300,140,2.4,,,,
4.625,1975.62,0.063825771,,,,,9.88,-26.87,,
4.875,1970,0.066423368,,,,,,,,
5.125,1964.39,0.057837761,,,,,,,99.19224556,0
5.375,1956.29,0.038124295,7600,1900,70,0.69,,,,
5.625,1948.19,0.021130601,,,,,6.6,-27.14,,
5.875,1940.08,0.018618849,,,,,,,,
6.125,1931.98,0.019621569,,,,,,,91.92825112,7.623318386
6.375,1928.17,0.012173345,7500,1900,57,0.61,,,,
6.625,1924.36,0.011422115,,,,,2.03,-26.84,,
6.875,1920.54,0.012290873,,,,,,,,
7.125,1916.73,0.009889201,,,,,,,67.32673267,30.44554455
7.375,1908.49,0.010313611,8300,1900,46,0.55,,,,
7.625,1900.26,0.008518601,,,,,1.56,-26.63,,
7.875,1892.02,0.008423684,,,,,,,,
8.125,1883.78,0.008307514,,,,,,,48.26789838,45.72748268
8.375,1874.78,0.008086348,7700,1500,28,0.39,,,,
8.625,1866.37,0.007920309,,,,,1.31,-26.66,,
8.875,1857.72,0.008470573,,,,,,,,
9.125,1848.83,0.009500857,,,,,1.1,-26.57,63.57466063,34.61538462
9.375,1839.7,0.008822984,8200,1500,27,0.42,,,,
9.625,1830.33,0.008322194,,,,,,,,
9.875,1820.73,0.007737618,,,,,,,,
10.125,1810.89,0.009139681,,,,,1.19,-26.66,38.18181818,60.77922078
10.375,1800.81,0.008866411,7300,1000,22,0.36,,,,
10.625,1790.49,0.009233503,,,,,,,,
10.875,1779.94,0.009553048,,,,,,,,
11.125,1769.14,0.008989856,,,,,0.63,-26.51,48.8700565,51.1299435
11.375,1758.11,0.00830988,6500,970,17,0.34,,,,
11.625,1746.84,0.007843139,,,,,,,,
11.875,1735.33,0.008911591,,,,,,,,
12.125,1723.59,0.006402951,,,,,0.59,-26.53,36.99059561,62.69592476
12.375,1711.6,0.007844279,4500,700,11,0.25,,,,
12.625,1699.38,0.006342522,,,,,,,,
12.875,1686.92,0.00582727,,,,,,,,
13.125,1674.23,0.004688441,,,,,1.02,-26.76,38.56041131,59.89717224
13.375,1661.29,0.005974773,3900,590,8.8,0.23,,,,
13.625,1648.12,0.006078542,,,,,,,,
13.875,1634.71,0.005798085,,,,,,,,
14.125,1621.06,0.005294491,,,,,0.88,-26.9,26.83615819,71.18644068
14.375,1607.17,0.006329112,3800,560,7.4,0.16,,,,
14.625,1593.04,0.005333492,,,,,,,,
14.875,1578.68,0.005979681,,,,,,,,
15.25,1556.69,0.00732149,,,,,0.16,-26.75,26.39296188,71.5542522
15.75,,0.005624772,,,,,,,,
16.25,,0.005426568,,,,,0.79,-26.85,93.33333333,4.761904762
16.75,,0.004616399,,,,,,,,
17.25,,0.005131782,,,,,1.46,-27.29,,
17.75,,0.006898658,,,,,,,,
18.25,,0.006522627,,,,,1.36,-26.71,,
18.75,,0.005801503,,,,,,,,
19.25,,0.006620656,,,,,1.81,-27.27,,
19.75,,0.004970344,,,,,,,,
20.25,,0.005253386,,,,,1.49,-26.56,,
20.75,,0.005709259,,,,,,,,
21.25,,0.005876788,,,,,1.81,-27.24,,
21.75,,0.005570214,,,,,,,,
22.25,,0.005648216,,,,,0.2,-26.37,,
22.75,,0.005321178,,,,,,,,
23.25,,0.005717279,,,,,1.15,-27.29,,
23.75,,0.004890984,,,,,,,,
24.25,,0.004610089,,,,,1.05,-27.25,,
24.75,,0.004503866,,,,,,,,
25.25,,0.004808118,,,,,1.22,-27.28,,
25.75,,0.004901238,,,,,,,,
10 changes: 5 additions & 5 deletions data/FileS9_ZScores_CSM-IMP.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Depth (cm),year,z_d15N,z_chla,z_P,z_Zn,Z_Cd,z_S.cons,mean
depth,year,z_d15N,z_chla,z_P,z_Zn,Z_Cd,z_S.cons,mean
0,2021.04,1.992103479,2.597660062,1.271586818,0.879950296,1.245704793,1.099482742,1.514414698
1,2014.55,1.891685372,1.692550449,1.2454153,1.205447201,1.382974468,1.080630792,1.416450597
2,2005.23,2.007552419,1.97487545,1.37627289,1.459776775,1.640943262,1.064315478,1.587289379
Expand All @@ -7,7 +7,7 @@
5,1964.39,0.882354655,0.583865737,-0.508076402,0.616473453,-0.265623675,1.087713003,0.399451129
6,1931.98,-0.294339573,-0.296350093,-0.508076402,0.230274953,-0.389469585,0.863554095,-0.065734434
7,1916.73,-0.415356266,-0.520511212,-0.508076402,-0.263185703,-0.586816908,0.109522398,-0.364070682
8,1910.092734,-0.479726848,-0.556941481,-0.612762473,-0.720190995,-0.791333939,-0.411644981,-0.595433453
9,1879.731084,-0.533798136,-0.529455775,-0.612762473,-0.80260441,-0.783866603,-0.011418306,-0.545650951
10,1845.706634,-0.510624727,-0.537774561,-0.743620063,-0.869503856,-0.808808869,-0.798077547,-0.711401604
11,1808.019384,-0.654814829,-0.541225414,-0.751471519,-0.965018144,-0.769614842,-0.465192048,-0.691222799
8,1883.78,-0.479726848,-0.556941481,-0.612762473,-0.720190995,-0.791333939,-0.411644981,-0.595433453
9,1848.83,-0.533798136,-0.529455775,-0.612762473,-0.80260441,-0.783866603,-0.011418306,-0.545650951
10,1810.89,-0.510624727,-0.537774561,-0.743620063,-0.869503856,-0.808808869,-0.798077547,-0.711401604
11,1769.14,-0.654814829,-0.541225414,-0.751471519,-0.965018144,-0.769614842,-0.465192048,-0.691222799
Loading

0 comments on commit 0bf4630

Please sign in to comment.