tdv {diffval} | R Documentation |
The Total Differential Value of a phytosociological table
Description
Given a phytosociological table and a partition of its columns, this function calculates the respective Total Differential Value (TDV).
Usage
tdv(m_bin, p, output_type = "normal")
Arguments
m_bin |
A matrix. A phytosociological table of 0s (absences) and 1s (presences), where rows correspond to taxa and columns correspond to relevés. |
p |
A vector of integer numbers with the partition of the relevés (i.e.,
a k-partition, consisting in a vector with values from 1 to k, with length
equal to the number of columns of |
output_type |
A character determining the amount of information returned by the function and also the amount of pre-validations. Possible values are "normal" (the default), "fast" and "full". |
Details
The function accepts a phytosociological table (m_bin
) and a
k-partition of its columns (p
), returning the corresponding TDV.
TDV was proposed by Monteiro-Henriques and Bellu (2014).
Monteiro-Henriques (2016) proposed TDV1, modifying TDV slightly with the
objective of ensuring a value from 0 to 1. Yet, TDV is always within that
range. In practice, both TDV and TDV1 have 0 as possible minimum value
and 1 as possible maximum value, but TDV1 reduces further the contribution
of differential taxa present in more than one group. TDV is then
implemented here, for parsimony.
TDV is calculated using the index for each (and all) of the
taxa present in a tabulated phytosociological table
(also called
sorted table).
index aims at characterizing how well a taxon
works as a differential taxon in a such tabulated phytosociological table
(for more information on differential taxa see Mueller-Dombois & Ellenberg,
1974).
An archetypal differential taxon of a certain group of the
partition
(a partition on the columns of
) is the one
present in all relevés of group
, and absent from all the other
groups of that partition. Therefore,
has two components, an
inner one (
), which measures the presence of the
taxon inside each of the groups, and an outer one (
),
which measures the relevant absences of the taxon outside of each of the
groups. Specifically, given a partition
with
groups,
is calculated for each taxon
as:
where:
-
, is the total number of presences of taxon
within group
.
-
, is the total number of relevés of group
.
-
, is the total number of differentiating absences of taxon
, i.e., absences coming from the groups other than
from which the taxon
is completely absent.
-
, is the total number of relevés of all groups but
(i.e., the total number of relevés in the table -
).
-
, is the total number of groups in which the taxon
occurs at least once.
Therefore, for each taxon and for each group
, the
index evaluates:
-
, i.e., the frequency of the presences of taxon
, relative to the size of group
; commonly called 'relative frequency.'
is only 1 if and only if taxon
occurs in all the relevés of group
.
-
, i.e., the frequency of the differentiating absences of taxon
outside group
, relative to the sum of sizes of all groups but
. Nota bene: absences in
are counted outside the group
but only in the groups from which taxon
is completely absent (these are the relevant absences, which produce differentiation among groups); in practice
corresponds to the sum of the sizes of all groups other than
that are empty.
is 1 if and only if the taxon
is absent from all groups but
.
Finally, ensures that
is a value
from 0 to 1.
The Total Differential Value (TDV or ) of a
phytosociological table
tabulated/sorted by the partition
is:
where:
-
, is the number of taxa in table
.
The division by the number of taxa present in ensures that TDV
remains in the [0,1] interval (as
is also in the same
interval).
Value
If output_type = "normal"
(the default) pre-validations are done
and a list is returned, with the following components:
- ifp
A matrix with the
values for each taxon in each group, for short called the 'inner frequency of presences'.
- ofda
A matrix with the
values for each taxon in each group, for short called the 'outer frequency of differentiating absences'.
- e
A vector with the
values for each taxon, i.e., the number of groups containing that taxon.
- diffval
A matrix with the
for each taxon.
- tdv
A numeric with the TDV of matrix
m_bin,
given the partitionp
.
If output_type = "full"
, some extra components are added to the output:
afg
, empty.size
, gct
(= ) and
i.mul
. These are intermediate
matrices used in the computation of TDV.
If output_type = "fast"
, only TDV is returned and no pre-validations are
done.
Author(s)
Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.
References
Monteiro-Henriques T. & Bellu A. 2014. An optimization approach to the production of differentiated tables based on new differentiability measures. 23rd EVS European Vegetation Survey. Presented orally. Ljubljana, Slovenia.
Monteiro-Henriques T. 2016. A bunch of R functions to assist phytosociological tabulation. 25th Meeting of European Vegetation Survey. Presented in poster. Rome. Italy.
Mueller-Dombois D. & Ellenberg H. 1974. Aims and Methods of Vegetation Ecology. New York: John Wiley & Sons.
Examples
# Getting the Taxus baccata forests data set
data(taxus_bin)
# Creating a group partition, as the one presented in the original article of
# the data set
groups <- rep(c(1, 2, 3), c(3, 11, 19))
# Removing taxa occurring in only one relevé, in order to reproduce exactly
# the example in the original article of the data set
taxus_bin_wmt <- taxus_bin[rowSums(taxus_bin) > 1, ]
# Calculating TDV
result <- tdv(taxus_bin_wmt, groups)
# This is the TDV
result$tdv
# This is TDV1, reproducing exactly the value from the original article
sum(result$diffval / result$e) / nrow(taxus_bin_wmt)