**Geochronology Plotting Scripts in R**
---------------------------------------
*[See change log here for updates][1]*
This project comprises a collection of scripts for plotting various kinds of geochronological and petrochronological data using R.
The code included in this package benefits greatly from the open source efforts of P. Vermeesch (see: https://www.ucl.ac.uk/~ucfbpve/isoplotr/ or doi: 10.1016/j.gsf.2018.04.001), A. Noda (https://github.com/anoda/UPbplot.py or doi: 10.9795/bullgsj.68.131) and Powell et al. (https://doi.org/10.5194/gchron-2-325-2020)
There are currently six main scripts:
1. Th-Pb Geochronology Script
3. U-Pb Geochronology Script
4. U-Pb T-W Concordia Script
4. Weighted Mean and KDE Plotting Script
3. Coloured Trace Element Spider Plots
4. Pb-Pb Age Script
***In order to use the various scripts, the ChrontouR package must be installed and loaded along with various other R packages as indicated in each induvidual script***
----------
***Th-Pb Geochronology Scripts***
This script plots Th-Pb concordia, calculates and plots weighted mean ages, and calculates Th-Pb dates based on data from an input .csv file.
*Where:*
**PbU** is the <sup>206</sup>Pb/<sup>238</sup>U ratio; **PbUe** is the uncertainty in the <sup>206</sup>Pb/<sup>238</sup>U ratio; **PbTh** is the <sup>208</sup>Pb/<sup>232</sup>Th ratio; **PbThe** is the uncertainty in the <sup>208</sup>Pb/<sup>232</sup>Th ratio; and **C** is an optional variable used colour the ellipses. Uncertainties can be absolute or %.
The script will also accept .xlsx input where the user specifies the column number in the table for the different variables
There are various user modifiable options within the script as annotated including, at the end, an option to output ages calculated from the input ratios.
Ellipse generation is after IsoplotR of P. Vermeesch - see: https://www.ucl.ac.uk/~ucfbpve/isoplotr/ or doi: 10.1016/j.gsf.2018.04.001
*NOTE - OUTPUT UNCERTAINTIES ARE BASED ON INPUT UNCERTAINTY (1SE in = 1SE out; 2SE in = 2SE out)*
----------
***U-Pb Geochronology Scripts***
This script plots U-Pb concordia (Wetherill), calculates and plots weighted means, and calculates U-Pb dates based on data from an input .csv file in the format:
Pb7U, Pb7Ue, Pb6U, Pb6Ue, rho, C.
*Where:*
**Pb7U** is the <sup>207</sup>Pb/<sup>235</sup>U ratio; **Pb7Ue** is the uncertainty in the <sup>207</sup>Pb/<sup>235</sup>U ratio; **Pb6U** is the <sup>206</sup>Pb/<sup>238</sup>U ratio; **Pb6Ue** is the uncertainty in the <sup>206</sup>Pb/<sup>238</sup>Th ratio; and **C** is an optional variable used colour the ellipses. Uncertainties can be absolute or %.
The script will also accept .xlsx input where the user specifies the column number in the table for the different variables
There are various user modifiable options within the script as annotated including, at the end, an option to output ages calculated from the input ratios.
Uncertainty covariance calculation and ellipse generation are after IsoplotR of P. Vermeesch - see: https://www.ucl.ac.uk/~ucfbpve/isoplotr/ or doi: 10.1016/j.gsf.2018.04.001
*NOTE - OUTPUT UNCERTAINTIES ARE BASED ON INPUT*
----------
***U-Pb T-W Concordia Script***
This script plots U-Pb Tera-Wasserberg concordia diagram, calculates and plots weighted means, intercept ages (including those comprising a subset of input data) and calculates U-Pb dates based on data from an input .csv file in the format:
Pb7U, Pb7Ue, Pb6U, Pb6Ue, rho.
Ellipses can be coloured by any variable.
*Where:*
**Pb7U** is the <sup>207</sup>Pb/<sup>235</sup>U ratio; **Pb7Ue** is the uncertainty in the <sup>207</sup>Pb/<sup>235</sup>U ratio; **Pb6U** is the <sup>206</sup>Pb/<sup>238</sup>U ratio; **Pb6Ue** is the uncertainty in the <sup>206</sup>Pb/<sup>238</sup>Th ratio. Uncertainties can be absolute or %.
The script will also accept .xlsx input where the user specifies the column number in the table for the different variables
There are various user modifiable options within the script as annotated including, at the end, an option to output ages calculated from the input ratios.
Uncertainty covariance calculations, MSWD calculations and ellipse generation are from IsoplotR of P. Vermeesch - see: https://www.ucl.ac.uk/~ucfbpve/isoplotr/ or doi: 10.1016/j.gsf.2018.04.001
Model 1 intercept regression and age calculations are based on UPbPlot.py of A. Noda see: https://github.com/anoda/UPbplot.py or doi: 10.9795/bullgsj.68.131 after Isoplot of Ludwig see: http://www.bgc.org/isoplot_etc/isoplot.html
Robust regression is after Powell et al. 2020 see: https://doi.org/10.5194/gchron-2-325-2020 and implemented based on the Python scripts contained therein.
*NOTE - OUTPUT UNCERTAINTIES ARE BASED ON INPUT*
----------
***Weighted Mean and KDE Plotting Script***
Script that calculates and plots weighted mean ages and optionally outputs normalized KDE density plots with peak ages identified. The weighted mean calculation is based on code by Noda, 2017 (doi: 10.9795/bullgsj.68.131) and the formula in McLean et al. 2011 (doi:10.1029/2010GC003478). Details on data input format are included within.
***Coloured Trace Element Spider Plots***
Scripts that take in trace element data from specimens and output a normalised spider plot where the individual lines are coloured by a variable of choice. Lines are plotted in variable order. For example, if the variable is age, lines corresponding to older ages are plotted first and lines corresponding to younger ages last to increase visual representation of the temporal evolution of the data. The type of normalisation can be selected in the script. The script will automatically detect, normalize and plot most elements if the example file format is adhered to. Because of this, only include the elements of interest in the input file.
[1]: https://osf.io/p46mb/wiki/Change%20Log/