Learn R Programming

detzrcr

detzrcr is an R-package for plotting and running statistical tests on univariate (U-Pb age) and bivariate (U-Pb age and Lu-Hf data) detrital zircon data for comparison between samples. The package uses a user interface built with shiny and produces publication quality figures using ggplot2.

Installation

Install either from CRAN

install.packages("detzrcr")

or install the development version from github (requires devtools)

# install.packages("devtools")
devtools::install_github("magnuskristoffersen/detzrcr")

Use package

Launch user interface with

library("detzrcr")
run_detzrcr()

For the sake of simplicity input data is required to be a csv-file which contains at least a column containing the U-Pb age data. This column must be called age, associated uncertainty and discordancy (if included) must be in columns uncert and disc, respectively. All ages must be in Ma.

The file can contain the Lu-Hf data in two ways: measured 176/177Hf and measured Lu/Hf in columns called hfhf and luhf, respectively; or a column with initial epsilon-Hf with the name ehf_i.

Several samples can be included in the csv-file and which one(s) to plot can be choosen interactively in the user interface. For this to work a column called sample must be present, and each analysis (i.e. each row) must contain the name of the sample it belongs to in this column.

Detrital zircon U-Pb and Lu-Hf example data from the Natal Group, KwaZulu-Natal, South Africa (Kristoffersen et al. 2016) are included in the package.

References

Kristoffersen, M., Andersen, T., Elburg, M.A., Watkeys, M.K., 2016. Detrital zircon in a supercontinental setting: locally derived and far-transported components in the Ordovician Natal Group, South Africa. J. Geol. Soc. London. 173, 203-215. https://dx.doi.org/10.1144/jgs2015-012

Copy Link

Version

Install

install.packages('detzrcr')

Monthly Downloads

236

Version

0.3.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Magnus Kristoffersen

Last Published

July 23rd, 2020

Functions in detzrcr (0.3.1)

hf_lines

Produce CHUR and DM lines
calc_ab

Calculate slope and intercept
hfhf_chur

176Hf/177Hf value of CHUR.
Natal_group

Dataset Natal group
concX

Calculate U235 at given age
o_param_matrix_age

Populate matrix with age 1-O
combine_matrices

Combine two square matrices
o_param_matrix_tdm

Populate matrix with model age 1-O
lambda_u235

Decay constants of 235U.
lambda_u238

Decay constants of 238U.
plot_labels

Labels for ggplot2 plots
satkoski_2d

Calculate 2d (age and Lu-Hf) likeness of detrital zircon populations
plot_point_scale

Add manual shape scale to scatter plot
satkoski_2d_matrix

Pairwise 2d Satkoski likeness
run_detzrcr

Launch shiny interface
find_plot_min

Find minimum value for plotting
calc_p_apply

Calculate intercepts and associated p-value
calc_o_param

Calculate 1-O
find_plot_min_max

Wrapper function for find_plot_min and find_plot_max
calc_dkw

Dvoretzky-Kiefer-Wolfowitz inequality
tile_func

Ready 1-O matrix for tile plot
calc_dens

Calculate 1D density of age data
check_conc

Check concordancy of input ages
calc_quantiles

Calculate quantiles
plot_quantiles

Plot quantiles
plot_tile

Tile plot of 1-O matrix
plot_text_options

Modify text options of plots
luhf_zrc

176Lu/177Hf value of average continental crust.
plot_reimink

Plot likelihood of intercept ages
calc_hf

Calculate hafnium values.
quant_bounds

Calculate confidence bands for lower and upper quartile
plot_hf

Plot Lu-Hf data
find_maxima

Find maxima.
plot_bw_theme

Stripped down theme for ggplot2
calc_dens_hist

Calculate scaled 1d density
dzr_mix

Calculate mixing model
lambda_lu

Decay constant of 176Lu.
plot_axis_lim

Axes limits for ggplot2
concY

Calculate U238 at given age
satkoski_1d

Calculate 1d likeness of detrital zircon populations
make_tiling

Produce data.frame of 1-O matrix suitable for geom_tile
u238_u235_ratio

Atomic ratio of 238U and 235U.
hfhf_dm

176Lu/177Hf value of DM.
reimink

Calculate upper and lower concordia intercepts from discordant detrital zircon data
tiling

Apply tile_func to vector
satkoski_1d_matrix

Pairwise Satkoski likeness
find_plot_max

Find maximum value for plotting.
luhf_chur

176Lu/177Hf value of CHUR.
plot_ecdf

Plot ecdf
luhf_dm

176Lu/177Hf value of DM.
plot_dens_hist

Plot 1d density with histogram
plot_dens

Plot 1d density
populate_matrix

Populate matrix