isocalcr
R Package containing widely used isotope theory functions
Science Score: 49.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 5 DOI reference(s) in README -
✓Academic publication links
Links to: wiley.com -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.5%) to scientific vocabulary
Last synced: 9 months ago
·
JSON representation
Repository
R Package containing widely used isotope theory functions
Basic Info
- Host: GitHub
- Owner: justinmathias
- Language: R
- Default Branch: main
- Size: 813 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 4
Created about 5 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.width = 7,
fig.height = 2.5)
```
# isocalcR
```{r, echo=FALSE, results='asis', message=FALSE}
#library(badger)
cat(
badger::badge_cran_release("isocalcR", "green"),
badger::badge_custom("Cite isocalcR", "in Global Change Biology", "blue", url = "https://onlinelibrary.wiley.com/doi/abs/10.1111/gcb.16407"),
badger::badge_cran_download("isocalcR", "grand-total", "orange"),
badger::badge_license("GPL-3", "blue"),
badger::badge_travis("justinmathias/isocalcR")
)
```
The goal of `isocalcR` is to provide a suite of user-friendly, open source functions for commonly performed calculations when working with stable isotope data. A major goal of `isocalcR` is to help eliminate errors associated with data compilation necessary for many standard calculations, as well as to provide the scientific community with a reliable, easily accessible resource for reproducible work. Part of this effort includes best practices of data usage, as the user is not required to download atmospheric CO~2~ or atmospheric δ^13^CO~2~ data for the workhorse calculations, but instead relies on published, peer-reviewed, and recommended publicly available data (Belmecheri and Lavergne, 2020). `isocalcR` is not meant to replace an understanding of the underlying physiological mechanisms related to these calculations, but instead to streamline the process. At present, calculations for years 0 C.E. - 2022 C.E. are stable and will work with all functions, with 2023 being added at the end of the year.
`isocalcR` 0.0.1 and `isocalcR` 0.0.2 incorporated photorespiratory processes into calculations where C~i~ was computed. `isocalcR` 0.1.0 added the option to specify the formulation used in calculating physiological indices where C~i~ is necessary for calculations (i.e. CiCa, diffCaCi, iWUE). Furthermore, `isocalcR` 0.1.0 added the function "custom.calc", which allows the user to specify variables such as atmospheric [CO2], that are automatically determined in other functions. The current release version of `isocalcR`, 0.1.1, updates the reference dataset for atmospheric CO~2~ and δ^13^CO~2~ to include 2022 values.
Please cite `isocalcR` as:
Mathias, J.M., & Hudiburg, T.W. (2022). isocalcR: An R package to streamline and standardize stable isotope calculations in ecological research. Global Change Biology, 28, 7428– 7436. [https://doi.org/10.1111/gcb.16407](https://doi.org/10.1111/gcb.16407).
## Installation
You can install the released version of isocalcR from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("isocalcR")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("justinmathias/isocalcR")
```
## Functionality
|`isocalcR` Function | Description |
|-------------------- |----------------------------------------------------------------------------------------------------------------|
|`d13C.to.D13C` | Calculate leaf carbon isotope discrimination (∆^13^C) given plant tissue δ^13^C signature (‰) |
|`d13C.to.Ci` | Calculate leaf intercellular CO~2~ concentration (ppm) given plant tissue δ^13^C signature (‰) |
|`d13C.to.CiCa` | Calculate the ratio of leaf intercellular CO~2~ to atmospheric CO~2~ concentration (ppm) given plant tissue δ^13^C signature (‰) |
|`d13C.to.diffCaCi` | Calculate the difference between atmospheric CO~2~ concentration (ppm) and leaf intercellular CO~2~ concentration (ppm) given plant tissue δ^13^C signature (‰) |
|`d13C.to.iWUE` | Calculate leaf intrinsic water use efficiency (µmol CO~2~ mol H~2~O^-1^) given plant tissue δ^13^C signature (‰) |
|`custom.calc` | Calculate ∆^13^C, Ci, CiCa, diffCaCi, or iWUE given plant tissue δ^13^C signature (‰) |
## Examples
Calculate leaf intrinsic water use efficiency from leaf δ^13^C:
```{r example}
library(isocalcR) #Load the package
library(tidyverse) #Load the tidyverse
#Calculate iWUE from leaf organic material with a δ13C signature of -27 ‰ for the year 2015, 300 meters above sea level at 25°C.
d13C.to.iWUE(d13C.plant = -27,
year = 2015,
elevation = 300,
temp = 25)
#Use custom.calc to calculate iWUE from the same leaf sample as above.
custom.calc(d13C.plant = -27,
d13C.atm = -8.44,
outvar = "iWUE",
Ca = 399.62,
elevation = 300,
temp = 25)
#Calculate the ratio of leaf intercellular to atmospheric CO2 (Ci/Ca) using the simple formulation for leaf and wood. Internally updates apparent fractionation by Rubisco, b, according to Cernusak and Ubierna 2022.
d13C.to.CiCa(d13C.plant = -27,
year = 2015,
elevation = 300,
temp = 25,
tissue = "leaf")
d13C.to.CiCa(d13C.plant = -27,
year = 2015,
elevation = 300,
temp = 25,
tissue = "wood")
#Calculate iWUE using the "simple", "photorespiration", and "mesophyll" formulations.
d13C.to.iWUE(d13C.plant = -28,
year = 2015,
elevation = 300,
temp = 15,
method = "simple")
d13C.to.iWUE(d13C.plant = -28,
year = 2015,
elevation = 300,
temp = 15,
method = "photorespiration")
d13C.to.iWUE(d13C.plant = -28,
year = 2015,
elevation = 300,
temp = 15,
method = "mesophyll")
```
Data for atmospheric CO~2~ and atmospheric δ^13^CO~2~ for the period 0 C.E. to 2021 C.E. can be loaded and viewed. Data are from Belmecheri and Lavergne (2020).
```{r CO2data}
data(CO2data) #Load CO2data into your environment
head(CO2data, 10) #View initial CO2data observations
tail(CO2data, 10) #View most recent CO2data observations
```
Data for piru13C can loaded, viewed, and used to calculate iWUE for each formulation. Data are from Mathias and Thomas (2018).
```{r piru13C}
data(piru13C)
head(piru13C)
#Calculate iWUE from tree ring (wholewood) d13C from Mathias and Thomas (2018)
#using previously loaded piru13C data
#First drop years where there are no data
piru13C <- piru13C %>%
drop_na()
#Calculate iWUE for each case using 'mapply'
piru13C$iWUE_simple <- mapply(d13C.to.iWUE, #Call the function
d13C.plant = piru13C$wood.d13C, #Assign the plant d13C value
year = piru13C$Year, #Assign the year to match atmospheric CO2 and atmospheric d13CO2
elevation = piru13C$Elevation_m, #Assign the elevation
temp = piru13C$MGT_C, #Assign the temperature
method = "simple", #Specify the method
tissue = "wood") #Specify which tissue the sample is from
piru13C$iWUE_photorespiration <- mapply(d13C.to.iWUE, #Call the function
d13C.plant = piru13C$wood.d13C, #Assign the plant d13C value
year = piru13C$Year, #Assign the year to match atmospheric CO2 and atmospheric d13CO2
elevation = piru13C$Elevation_m, #Specify elevation
temp = piru13C$MGT_C, #Specify the temperature during tissue formation
method = "photorespiration", #Specify the iWUE calculation formulation
frac = piru13C$frac) #Specify any post-photosynthetic fractionations. In this case 2 permille to account for leaf to wood.
piru13C$iWUE_mesophyll <- mapply(d13C.to.iWUE, #Call the function
d13C.plant = piru13C$wood.d13C, #Assign the plant d13C value
year = piru13C$Year, #Assign the year to match atmospheric CO2 and atmospheric d13CO2
elevation = piru13C$Elevation_m, #Specify elevation
temp = piru13C$MGT_C, #Specify the temperature during tissue formation
method = "mesophyll", #Specify the iWUE calculation formulation
frac = piru13C$frac) #Specify any post-photosynthetic fractionations. In this case 2 permille to account for leaf to wood.
#Create dataframe for visualizing differences in computed iWUE among the three formulations
piru13C_long <- piru13C %>%
select(Year, Site, iWUE_simple, iWUE_photorespiration, iWUE_mesophyll) %>% #Select only columns of interest
rename(Simple = iWUE_simple,
Photorespiration = iWUE_photorespiration,
Mesophyll = iWUE_mesophyll) %>%
pivot_longer(names_to = "Formulation", values_to = "iWUE", -c(Year, Site))
#Visually examine differences in iWUE based on the formulation used for each study location
ggplot(data = piru13C_long, aes(x = Year, y = iWUE, color = Formulation)) +
geom_point(alpha = 0.5) +
geom_smooth(aes(group = Formulation), color = "gray30") +
theme_classic() +
facet_wrap(~Site) +
ylab(expression("iWUE (µmol mol"^{-1}*")"))
```
## Literature cited
Badeck, F.-W., Tcherkez, G., Nogués, S., Piel, C. & Ghashghaie, J. (2005). Post-photosynthetic fractionation of stable carbon isotopes between plant organs—a widespread phenomenon. Rapid Commun. Mass Spectrom., 19, 1381–1391.
Belmecheri, S. & Lavergne, A. (2020). Compiled records of atmospheric CO~2~ concentrations and stable carbon isotopes to reconstruct climate and derive plant ecophysiological indices from tree rings. Dendrochronologia, 63, 125748.
Bernacchi, C.J., Singsaas, E.L., Pimentel, C., Portis Jr, A.R. & Long, S.P. (2001). Improved temperature response functions for models of Rubisco-limited photosynthesis. Plant, Cell Environ., 24, 253–259.
Craig, H. (1953). The geochemistry of the stable carbon isotopes. Geochim. Cosmochim. Acta, 3, 53–92.
Cernusak, L. A. & Ubierna, N. Carbon Isotope Effects in Relation to CO~2~ Assimilation by Tree Canopies. in Stable Isotopes in Tree Rings: inferring physiological, climatic, and environmental responses 291–310 (2022).
Davies, J.A. & Allen, C.D. (1973). Equilibrium, Potential and Actual Evaporation from Cropped Surfaces in Southern Ontario. J. Appl. Meteorol., 12, 649–657.
Farquhar, G., O’Leary, M. & Berry, J. (1982). On the relationship between carbon isotope discrimination and the intercellular carbon dioxide concentration in leaves. Aust. J. Plant Physiol., 9, 121–137.
Frank, D.C., Poulter, B., Saurer, M., Esper, J., Huntingford, C., Helle, G., et al. (2015). Water-use efficiency and transpiration across European forests during the Anthropocene. Nat. Clim. Chang., 5, 579–583.
Gong, X. Y. et al. Overestimated gains in water‐use efficiency by global forests. Glob. Chang. Biol. 1–12 (2022)
Lavergne, A. et al. Global decadal variability of plant carbon isotope discrimination and its link to gross primary production. Glob. Chang. Biol. 28, 524–541 (2022).
Ma, W. T. et al. Accounting for mesophyll conductance substantially improves ^13^C-based estimates of intrinsic water-use efficiency. New Phytol. 229, 1326–1338 (2021).
Mathias, J. M. & Thomas, R. B. Disentangling the effects of acidic air pollution, atmospheric CO2 , and climate change on recent growth of red spruce trees in the Central Appalachian Mountains. Glob. Chang. Biol. 24, 3938–3953 (2018).
Tsilingiris, P.T. (2008). Thermophysical and transport properties of humid air at temperature range between 0 and 100°C. Energy Convers. Manag., 49, 1098–1110.
Ubierna, N. & Farquhar, G.D. (2014). Advances in measurements and models of photosynthetic carbon isotope discrimination in C~3~ plants. Plant. Cell Environ., 37, 1494–1498.
Owner
- Name: Justin Mathias
- Login: justinmathias
- Kind: user
- Location: Moscow, ID
- Company: University of Idaho
- Website: mathiasecology.com
- Twitter: mathias__jm
- Repositories: 3
- Profile: https://github.com/justinmathias
I am a postdoctoral fellow at the University of Idaho, Department of Forests, Rangeland, and Fire Sciences.
GitHub Events
Total
- Push event: 1
Last Year
- Push event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| justinmathias | j****s@g****m | 171 |
| Justin Mathias | 5****s | 1 |
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 297 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: isocalcR
Isotope Calculations in R
- Homepage: https://github.com/justinmathias/isocalcR
- Documentation: http://cran.r-project.org/web/packages/isocalcR/isocalcR.pdf
- License: GPL-3
-
Latest release: 0.1.1
published about 3 years ago
Rankings
Forks count: 21.9%
Dependent packages count: 29.8%
Stargazers count: 35.2%
Dependent repos count: 35.5%
Average: 35.5%
Downloads: 55.0%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.0.0 depends
- dplyr * suggests
- ggplot2 * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- tidyr * suggests
.github/workflows/R-CMD-check.yaml
actions
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
.github/workflows/check-standard.yaml
actions
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/check-r-package v1 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-r-dependencies v1 composite