sedproxy

An R package for modelling sediment archived climate proxy records.

https://github.com/earthsystemdiagnostics/sedproxy

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

An R package for modelling sediment archived climate proxy records.

Basic Info
Statistics
  • Stars: 7
  • Watchers: 2
  • Forks: 1
  • Open Issues: 2
  • Releases: 2
Created over 7 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---

# Sedproxy: Simulation of Sediment Archived Climate Proxy Records.


[![R-CMD-check](https://github.com/EarthSystemDiagnostics/sedproxy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/EarthSystemDiagnostics/sedproxy/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/EarthSystemDiagnostics/sedproxy/branch/master/graph/badge.svg?token=hht8uueIsX)](https://codecov.io/gh/EarthSystemDiagnostics/sedproxy)


```{r knitr_setup, echo=FALSE}
knitr::opts_chunk$set(dev = "svg",
                      fig.path = "man/figures/README-",
                      out.width = "100%")
```


## Introduction


`sedproxy` provides a forward model for sediment archived climate proxies. The forward model and its applications are described in detail in [(Dolman and Laepple, CP 2018)](https://www.clim-past.net/14/1851/2018/cp-14-1851-2018.html).

Please contact Dr Andrew Dolman <>, or Dr Thomas Laepple <>, at the Alfred-Wegener-Institute, Helmholtz Centre for Polar and Marine Research, Germany, for more information.

This work was supported by German Federal Ministry of Education and Research (BMBF) as Research for Sustainability initiative [FONA](https://www.fona.de/) through the [PalMod](https://www.palmod.de/) project (FKZ: 01LP1509C). 

![](man/figures/PalMod_Logo_RGB.png)

## Installation

**sedproxy** is available from CRAN

```{r, eval=FALSE}
install.packages("sedproxy")
```

Or the development version can be installed directly from GitHub

```{r, eval=FALSE}
if (!require("remotes")) {
  install.packages("remotes")
}

remotes::install_github("EarthSystemDiagnostics/sedproxy")
```

## Shiny app

A Shiny app is available via an additional package `shinysedproxy` which is currently only available on Github

[shinysedproxy](https://github.com/EarthSystemDiagnostics/shinysedproxy)


```{r, eval=FALSE}
remotes::install_github("EarthSystemDiagnostics/shinysedproxy")
```

It provides a graphical user interface to the main `sedproxy` function `ClimToProxyClim`. Currently this app forward models a proxy from a randomly generated input climate and serves only to illustrate the functionality of `sedproxy`. The user can alter the parameters of the forward model and observe the results graphically. In future versions it may be possible to load input climates and other input parameters from a file and to save the output.

To run the Shiny app enter the following in the R terminal:

```{r run_shiny, eval=FALSE}
library(shinysedproxy)
ShinySedproxy()
```

![](man/figures/sedproxy-screenshot.png)

An online version of the Shiny app is hosted at [shinyapps.io](https://limnolrgy.shinyapps.io/sedproxy-shiny/)



Below are some brief examples of how to run `sedproxy` from a script or the command line.

## Example data

`sedproxy` includes example data for a single sediment core and location: core number 41 in the Shakun et al. (2012) compilation (`r sedproxy::N41.proxy.details$Core`, Rosenthal et al. 2003). The climate signal is taken from the [TraCE-21ka](http://www.cgd.ucar.edu/ccr/TraCE/) Simulation of Transient Climate Evolution over the last 21,000 years, using the grid cell closest to core `r sedproxy::N41.proxy.details$Core`. Seasonality of *G.ruber*, the Foraminifera for which test Mg/Ca ratios were measured, is taken from the model of Fraile et al (2008). Sediment accumulation rates were estimated from the depth and age data associated with core `r sedproxy::N41.proxy.details$Core`, with a minimum rate of 0.2 * the mean rate.


**The `r sedproxy::N41.proxy.details$Core` core**

```{r message = FALSE, warning = FALSE}
library(tidyverse)
library(knitr)
library(sedproxy)
```


```{r}
N41.proxy.details %>% 
  mutate_if(is.numeric, round, digits = 2) %>% 
  gather() %>% 
  kable(., format = "markdown", digits = 2)
```


**Input climate signal**

The first 5 rows:

```{r}
(N41.t21k.climate[1:5,]-273.15) %>% 
  kable(., format = "markdown", digits = 2)
```

**Actual proxy record**

Core `r sedproxy::N41.proxy.details$Core` (Rosenthal et al. 2003)

```{r}
kable(head(N41.proxy), format = "markdown")
```

*******

## Function `ClimToProxyClim`

`ClimToProxyClim` is the main function in package `sedproxy`. It simulates a sediment archived proxy from an assumed true climate signal, the sediment accumulation rate, seasonality of the encoding organism/process, and the number of samples per timepoint.


```{r , fig.show='hold', warning=FALSE}
set.seed(26052017)
clim.in <- N41.t21k.climate[nrow(N41.t21k.climate):1,] - 273.15

# The input climate signal should be a time series object
# The Trace simulation runs to the year 1990 AD, therefore the start time for 
# the input climate is -39 years BP
clim.in <- ts(clim.in, start = -39)

PFM <- ClimToProxyClim(clim.signal = clim.in,
                       timepoints = round(N41.proxy$Published.age),
                       calibration.type = "identity",
                       habitat.weights = N41.G.ruber.seasonality,
                       sed.acc.rate = N41.proxy$Sed.acc.rate.cm.ka,
                       sigma.meas = 0.23,
                       sigma.ind = 2,
                       n.samples = 30,
                       n.replicates = 10)
```


```{r}
PFM$everything
```

**Simple plotting**

```{r default_plot, fig.width=6, fig.height=5.5}
PFM %>% 
  PlotPFMs(max.replicates = 1)
```


**Plot 5 replicates of the final simulated proxy**

```{r plot_reps, fig.width=6, fig.height=5.5}
PFM %>% 
  #filter(stage == "simulated.proxy") %>% 
  PlotPFMs(., max.replicates = 5, plot.stages = "simulated.proxy")
```


**Conversion to proxy units**
 
The initial input climate signal can be converted into "proxy units" if a `calibration.type` is specified. This simulates the Environment -> Sensor stage of the proxy system.

```{r MgCa, fig.show='hold', warning=FALSE, echo=FALSE, eval=TRUE}
set.seed(26052017)
PFM_2 <- ClimToProxyClim(clim.signal = clim.in, 
                         timepoints = round(N41.proxy$Published.age),
                         calibration.type = "MgCa",
                         #calibration = "Ten planktonic species_350-500",
                         habitat.weights = N41.G.ruber.seasonality,
                         sed.acc.rate = N41.proxy$Sed.acc.rate.cm.ka,
                         sigma.meas = 0.46,
                         sigma.ind = 0,
                         n.samples = 30,
                         n.replicates = 1)
```


```{r MgCa_plot, fig.width=6, fig.height=5.5, echo=FALSE, eval=TRUE}
PFM_2 %>%
  PlotPFMs(.) 
```




## Literature cited

Dolman, A. M. and Laepple, T.: Sedproxy: a forward model for sediment archived climate proxies, Clim. Past Discuss., https://doi.org/10.5194/cp-2018-13, in review, 2018.

Fraile, I., Schulz, M., Mulitza, S., & Kucera, M. (2008): Predicting the global distribution of planktonic foraminifera using a dynamic ecosystem model. Biogeosciences, 5: 891–911.

Laepple, T., & Huybers, P. (2013): Reconciling discrepancies between Uk37 and Mg/Ca reconstructions of Holocene marine temperature variability. Earth and Planetary Science Letters, 375: 418–429.

Rosenthal, Y., Oppo, D. W., & Linsley, B. K. (2003): The amplitude and phasing of climate change during the last deglaciation in the Sulu Sea, western equatorial Pacific. Geophys. Res. Lett., 30: 1428.

Shakun, J. D., Clark, P. U., He, F., Marcott, S. A., Mix, A. C., Liu, Z., Otto-Bliesner, B., Schmittner, A., & Bard, E. (2012): Global warming preceded by increasing carbon dioxide concentrations during the last deglaciation. Nature, 484: 49–54.


Owner

  • Name: EarthSystemDiagnostics
  • Login: EarthSystemDiagnostics
  • Kind: organization

Code respository for the Earth System Diagnostics research team including the SPACE ERC Starting grant project

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Push event: 7
  • Pull request event: 1
  • Create event: 1
Last Year
  • Issues event: 1
  • Watch event: 1
  • Push event: 7
  • Pull request event: 1
  • Create event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 337
  • Total Committers: 2
  • Avg Commits per committer: 168.5
  • Development Distribution Score (DDS): 0.003
Past Year
  • Commits: 5
  • Committers: 1
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Andrew Dolman a****n@g****m 336
tlaepple t****e@a****e 1
Committer Domains (Top 20 + Academic)
awi.de: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 2
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.67
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • teunbrand (1)
  • andrewdolman (1)
Pull Request Authors
  • andrewdolman (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 3
  • Total downloads:
    • cran 318 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 1
proxy.golang.org: github.com/earthsystemdiagnostics/sedproxy
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 1.6%
Average: 4.1%
Dependent packages count: 6.5%
Last synced: 10 months ago
proxy.golang.org: github.com/EarthSystemDiagnostics/sedproxy
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 10 months ago
cran.r-project.org: sedproxy

Simulation of Sediment Archived Climate Proxy Records

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 318 Last month
Rankings
Stargazers count: 20.7%
Forks count: 21.3%
Dependent repos count: 24.3%
Average: 26.2%
Dependent packages count: 27.9%
Downloads: 36.9%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.0.0 depends
  • dplyr * imports
  • ggplot2 * imports
  • mvtnorm * imports
  • readr * imports
  • rlang * imports
  • shiny * imports
  • stats * imports
  • tidyr * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • tidyverse * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action 4.1.4 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite