unmix: Unmix detrital age distributions

View source: R/unmix.R

unmixR Documentation

Unmix detrital age distributions

Description

Estimates the proportions of specified source datasets in each sink dataset by fitting a weighted combination of the sources' empirical cumulative distribution functions.

Usage

unmix(
  x,
  nsources = 2,
  source_names = names(x)[1:nsources],
  plot = TRUE,
  boot = (length(x) - length(source_names) == 1),
  nboot = 500,
  hide = NULL,
  sigdig = 2,
  ...
)

Arguments

x

a named list of numeric vectors containing the source and sink datasets.

nsources

the number of source datasets at the start of x, used when source_names is not supplied.

source_names

names of the source datasets. Datasets in x not named here are treated as sinks.

plot

logical flag indicating whether to plot the empirical cumulative distributions, fitted distributions, and estimated proportions.

boot

logical flag indicating whether to bootstrap the source datasets to estimate confidence limits for the proportions.

nboot

number of bootstrap replicates.

hide

vector with indices of samples that should be removed from the plot.

sigdig

the number of significant digits for the results plot.

...

additional graphical parameters passed to the plots.

Details

The input is a named list of numeric vectors. The first nsources vectors are treated as sources by default; all remaining vectors are treated as sinks. The source proportions are constrained to be between zero and one and to sum to one. With boot=TRUE, the source observations are resampled to estimate confidence limits for the proportions.

Value

If boot=FALSE, a matrix with one row per sink and columns for the estimated source proportions and the Cramer-von Mises fit statistic. If boot=TRUE, a list containing this matrix (prop) and matrices of lower (ll) and upper (ul) bootstrap confidence limits for the source proportions.

Examples

attach(examples)
fit <- unmix(DZ, sources=c('N1','N4','N14'), plot=FALSE)
print(fit)

IsoplotR documentation built on Oct. 17, 2026, 5:06 p.m.