Dfun | R Documentation |
Field sampling is biased to particular parts of a gradient. As such taxa occupy a particular part of this gradient. However, a increase or decrease in occurrence along this gradient might simply because particular parts of the gradient are unequally sampled. The KS-test compares the Theoretical Cumulative Distribution Function of a chosen distribution to the Empirical Cumulative Distribution of a sample. The deviation of the two is expressed as D. This method compares the Empirical Cumulative Distribution of a sampled taxa to the Empirical Cumulative Distribution of the sample. D then denotes the "strength" of the deviation from the entire sampled gradient (sample effort). The D is calculated by subtracting the Empirical Cumulative Distribution of the samples from the Empirical Cumulative Distribution of the taxa. In both cases the Empirical Cumulative Distributions are normalized between 0-1 as such D can only obtain a value between -1 or 01. How closer this value is to 0 the less the distribution of the species deviates from the "sample effort". The location wher D is either at minimal or maximal is denoted as the Split (S) this value indicates the location along the gradient where the Deviation between the Empirical Distributions is as maximum. In simplicity this can be noted as the sample "threshold" where the species distribution along a gradient deviates at maximum from the sample gradient. This whole process is bootstrapped with the "Bayesian Bootstrap" (BB) (Rubin et al. 1981), which is more a smoothed version of the classical bootstrap. As the BB uses the Dirichlet distribution as the prior reflects a flat/uniform prior returning the likelihood. The question is if this is really Bayesian. Preferred is that the intervals are simply interpreted as confidence intervals considering that the principle of indifference is not a reasonable assumption at al. The plot an idea are derived from TITAN (Bakker and King, 2010). However, the method is comparatively faster simpler and easier to interpret.
Dfun(gradient, taxa, xlab = "Gradient", nboot = 1000, size = 10)
gradient |
A numeric vector representing the gradient along which the taxa has been observed (e.g. concentration of nutrients). |
taxa |
A character vector with the names of all taxa needs to be the same length at the gradient. |
xlab |
An argument representing the name of the gradient. |
nboot |
The number of bootstraps used in the analysis. |
size |
Size of the point in plot "A". Default is 10 but might be to large. |
The function returns a list of three objects: a data frame with the Taxa with D an S, a data frame with S for all taxa and a plotted figure (ggplot2).
## Not run: library(readr) df <- read_csv(url("https://raw.githubusercontent.com/snwikaij/Data/main/Aquatic_Botany_Kaijser_et_al._2019.csv")) #Run the analysis results <- Dfun(df$Mediaan, df$Soort, size=6) #Display the results results$Plot ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.