View source: R/CTS_4_sources.R
| CTS_4_sources | R Documentation |
Solves determined systems for 3 tracers and 4 sources to assess solution dispersion and discriminant capacity.
CTS_4_sources(source, mixture, iter = 1000, seed = 123456, verbose = TRUE)
triplets(source, mixture, iter = 1000, seed = 123456, verbose = TRUE)
CTS_seeds_triplets(source, mixture, iter = 1000, seed = 123456, verbose = TRUE)
source |
Data frame of sediment sources containing 4 source rows, mean values, standard deviations, and sample size ('n'). |
mixture |
Data frame of mixture samples. |
iter |
Number of Monte Carlo iterations. Default is 1000. |
seed |
Integer seed for reproducibility. Default is 123456. |
verbose |
Logical. Whether to show a progress bar in the console. Default is TRUE. |
A data.frame ordered by max_dw (lowest dispersion first) containing:
id |
Triplet of tracer names used for the system. |
w1, w2, w3, w4 |
Calculated proportion contributions for Sources 1 through 4. |
dw1, dw2, dw3, dw4 |
Dispersion uncertainties for Sources 1 through 4 (half 84% - 16% quantile range). |
cons |
Proportion of Monte Carlo iterations yielding physically valid proportions. |
max_dw |
Maximum dispersion uncertainty across all four sources. |
# Prepare small dummy datasets for 4 sources and 3 tracers
src <- data.frame(
ID = c("Src1", "Src2", "Src3", "Src4"),
Tracer1 = c(10.5, 20.2, 5.0, 15.1),
Tracer2 = c(2.1, 8.5, 12.3, 4.2),
Tracer3 = c(0.5, 1.2, 3.4, 0.9),
Tracer1_SD = c(1.1, 1.8, 0.5, 0.8),
Tracer2_SD = c(0.3, 0.9, 1.1, 0.4),
Tracer3_SD = c(0.1, 0.2, 0.3, 0.1),
n = c(10, 10, 10, 10)
)
mix <- data.frame(ID = "Mix1", Tracer1 = 12.0, Tracer2 = 6.0, Tracer3 = 1.5)
# Run engine
result <- CTS_4_sources(source = src, mixture = mix, iter = 100, verbose = FALSE)
head(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.