kulczynski | R Documentation |
Kulczynski beta diversity metric.
kulczynski(counts, weighted = TRUE, pairs = NULL, cpus = n_cpus())
counts |
An OTU abundance matrix where each column is a sample, and
each row is an OTU. Any object coercible with |
weighted |
If |
pairs |
Which combinations of samples should distances be
calculated for? The default value ( |
cpus |
How many parallel processing threads should be used. The
default, |
A dist
object.
In the formulas below, x
and y
are two columns (samples) from counts
.
n
is the number of rows (OTUs) in counts
.
t = \displaystyle \sum_{i = 1}^{n} min(x_i,y_i)
D = \displaystyle 1 - 0.5(\frac{t}{\sum_{i = 1}^{n} x_i} + \frac{t}{\sum_{i = 1}^{n} y_i})
x <- c(4, 0, 3, 2, 6) y <- c(0, 8, 0, 0, 5) t <- sum(pmin(x,y)) 1 - (t/sum(x) + t/sum(y)) / 2 #> 0.6410256
Kulcynski S 1927. Die Pflanzenassoziationen der Pieninen. Bulletin International de l'Académie Polonaise des Sciences et des Lettres, Classe des Sciences Mathématiques et Naturelles, Série B: Sciences Naturelles.
Other beta_diversity:
bray_curtis()
,
canberra()
,
euclidean()
,
generalized_unifrac()
,
gower()
,
jaccard()
,
manhattan()
,
unweighted_unifrac()
,
variance_adjusted_unifrac()
,
weighted_normalized_unifrac()
,
weighted_unifrac()
# Example counts matrix
ex_counts
# Kulczynski weighted distance matrix
kulczynski(ex_counts)
# Kulczynski unweighted distance matrix
kulczynski(ex_counts, weighted = FALSE)
# Only calculate distances for A vs all.
kulczynski(ex_counts, pairs = 1:3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.