Skip to content

Commit

Permalink
+ download data from osf
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasHohmann committed Dec 14, 2023
1 parent 41eb821 commit 19005d9
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 8 deletions.
21 changes: 14 additions & 7 deletions REPRODUCEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,29 @@ For a description of the data generated by Matlab, see _codebook.md_ in the _dat

### 1.2 Extract age-depth models from CarboCATLite

Run _data/matlab_outputs/get_adm_from_carbocat_outputs.m" in matlab. This extracts age-depth information from the CarboCATLite outputs and generates the file "scenarioA_and_B_matlab_to_R.mat", which can be read into R.
Run _data/matlab_outputs/get_adm_from_carbocat_outputs.m" in Matlab. This extracts age-depth information from the CarboCATLite outputs and generates the file "scenarioA_and_B_matlab_to_R.mat", which can be read into R.

### 1.3 Run analyses in R

Open the R Project in Rstudio as described in _README_. Then run

```{R}
```r
source("code/process_adm_from_matlab.R")
```

in R. This imports the age-depth models into R, calculates hiatus durations and (in)completeness, and saves the results in "data/R_outputs/ageDepthModelsScenariosAandB.Rdata". See _codebook.md_ in the same folder for a description of the data saved.

Next, run

```{R}
```r
source("code/parameters_for_tests.R")
```

to load the parameters for the sets, and save them under "data/R_outputs/parameters_for_tests.Rdata". See _codebook.md_ in the same folder for a description of the data saved.

Last, run

```{R}
```r
source("code/simulate_and_test_modes_of_evolution.R")
```

Expand All @@ -69,15 +69,22 @@ From here, you can continue to inspect the generated data or generate the plots

## 2. Inspection of provided data

All produced data is in the folder _/data/_. For a detailed description of the data structure and contents see the file _/data/R_outputs/codebook.md_ (for outputs from R) and _/data/matlab_outputs/codebook.md_ (for outputs from matlab).
First, download the supporting data from the Open Science Framework (OSF) by running the following code in R

```r
source("code/utils.R")
get_data_from_osf(link = "https://osf.io/zbpwa/")
```

All downloaded data is in the folder _/data/_. For a detailed description of the data structure and contents see the file _/data/R_outputs/codebook.md_ (for outputs from R) and _/data/matlab_outputs/codebook.md_ (for outputs from matlab).

R outputs can be visualized using the scripts in _code/visualize_data.R_.

## 3. Reproduction of figures

To reproduce the figures in the main test and supplementary material, open the R project ad described in the _README_, and run
To reproduce the figures in the main test and supplementary material, open the R project ad described in the _README_, download the data as described in the section above, and run

```{R}
```r
source("code/make_plots.R")
```

Expand Down
204 changes: 203 additions & 1 deletion renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.3.1",
"Version": "4.3.2",
"Repositories": [
{
"Name": "CRAN",
Expand Down Expand Up @@ -126,6 +126,38 @@
],
"Hash": "45f0398006e83a5b10b72a90663d8d8c"
},
"Rcpp": {
"Package": "Rcpp",
"Version": "1.0.10",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"methods",
"utils"
],
"Hash": "e749cae40fa9ef469b6050959517453c"
},
"askpass": {
"Package": "askpass",
"Version": "1.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"sys"
],
"Hash": "cad6cf7f1d5f6e906700b9d3e718c796"
},
"cachem": {
"Package": "cachem",
"Version": "1.0.8",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"fastmap",
"rlang"
],
"Hash": "c35768291560ce302c0a6589f92e837d"
},
"cli": {
"Package": "cli",
"Version": "3.6.1",
Expand Down Expand Up @@ -161,6 +193,31 @@
],
"Hash": "f20c47fd52fae58b4e377c37bb8c335b"
},
"crul": {
"Package": "crul",
"Version": "1.4.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R6",
"curl",
"httpcode",
"jsonlite",
"mime",
"urltools"
],
"Hash": "1eb00a531331c91d970f3af74b75321f"
},
"curl": {
"Package": "curl",
"Version": "5.2.0",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "ce88d13c0b10fe88a37d9c59dba2d7f9"
},
"doParallel": {
"Package": "doParallel",
"Version": "1.0.17",
Expand Down Expand Up @@ -194,6 +251,13 @@
"Repository": "CRAN",
"Hash": "8106d78941f34855c440ddb946b8f7a5"
},
"fastmap": {
"Package": "fastmap",
"Version": "1.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "f7736a18de97dea803bde0a2daaafb27"
},
"foreach": {
"Package": "foreach",
"Version": "1.5.2",
Expand All @@ -207,6 +271,17 @@
],
"Hash": "618609b42c9406731ead03adf5379850"
},
"fs": {
"Package": "fs",
"Version": "1.6.2",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "94af08e0aa9675a16fadbb3aaaa90d2a"
},
"ggplot2": {
"Package": "ggplot2",
"Version": "3.4.1",
Expand Down Expand Up @@ -272,6 +347,28 @@
],
"Hash": "b44addadb528a0d227794121c00572a0"
},
"httpcode": {
"Package": "httpcode",
"Version": "0.3.0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "13641a1c6d2cc98801b76764078e17ea"
},
"httr": {
"Package": "httr",
"Version": "1.4.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"R6",
"curl",
"jsonlite",
"mime",
"openssl"
],
"Hash": "ac107251d9d9fd72f0ca8049988f1d7f"
},
"isoband": {
"Package": "isoband",
"Version": "0.2.7",
Expand All @@ -294,6 +391,16 @@
],
"Hash": "8954069286b4b2b0d023d1b288dce978"
},
"jsonlite": {
"Package": "jsonlite",
"Version": "1.8.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"methods"
],
"Hash": "266a20443ca13c65688b2116d5220f76"
},
"labeling": {
"Package": "labeling",
"Version": "0.4.2",
Expand Down Expand Up @@ -343,6 +450,17 @@
],
"Hash": "7ce2733a9826b3aeb1775d56fd305472"
},
"memoise": {
"Package": "memoise",
"Version": "2.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"cachem",
"rlang"
],
"Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c"
},
"mgcv": {
"Package": "mgcv",
"Version": "1.8-41",
Expand All @@ -360,6 +478,16 @@
],
"Hash": "6b3904f13346742caa3e82dd0303d4ad"
},
"mime": {
"Package": "mime",
"Version": "0.12",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"tools"
],
"Hash": "18e9c28c1d3ca1560ce30658b22ce104"
},
"mnormt": {
"Package": "mnormt",
"Version": "2.1.1",
Expand Down Expand Up @@ -395,6 +523,35 @@
],
"Hash": "02e3c6e7df163aafa8477225e6827bc5"
},
"openssl": {
"Package": "openssl",
"Version": "2.1.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"askpass"
],
"Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5"
},
"osfr": {
"Package": "osfr",
"Version": "0.2.9",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"crul",
"fs",
"httr",
"jsonlite",
"memoise",
"purrr",
"rlang",
"stringi",
"tibble"
],
"Hash": "1f8c66528602fda4eef0c2e11eda5a57"
},
"paleoTS": {
"Package": "paleoTS",
"Version": "0.5.3",
Expand Down Expand Up @@ -436,6 +593,21 @@
],
"Hash": "01f28d4278f15c76cddbea05899c5d6f"
},
"purrr": {
"Package": "purrr",
"Version": "1.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"cli",
"lifecycle",
"magrittr",
"rlang",
"vctrs"
],
"Hash": "d71c815267c640f17ddbf7f16144b4bb"
},
"renv": {
"Package": "renv",
"Version": "1.0.2",
Expand Down Expand Up @@ -505,6 +677,13 @@
],
"Hash": "671a4d384ae9d32fc47a14e98bfa3dc8"
},
"sys": {
"Package": "sys",
"Version": "3.4.2",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "3a1be13d68d47a8cd0bfd74739ca1555"
},
"tibble": {
"Package": "tibble",
"Version": "3.2.1",
Expand All @@ -524,6 +703,29 @@
],
"Hash": "a84e2cc86d07289b3b6f5069df7a004c"
},
"triebeard": {
"Package": "triebeard",
"Version": "0.4.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"Rcpp"
],
"Hash": "642507a148b0dd9b5620177e0a044413"
},
"urltools": {
"Package": "urltools",
"Version": "1.7.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"Rcpp",
"methods",
"triebeard"
],
"Hash": "e86a704261a105f4703f653e05defa3e"
},
"utf8": {
"Package": "utf8",
"Version": "1.2.3",
Expand Down

0 comments on commit 19005d9

Please sign in to comment.