Skip to contents

This function checks if one relevé (rel1) is included in a second relevé (rel2). This is asymmetrical, i.e. rel1 might be included in rel2 while rel2 is not included in rel 1 (and vice versa).

Usage

inc_or_ide_rels(m, plot.im = FALSE)

Arguments

m

matrix A relevé matrix (each column containing a phytosociological relevé) of 1 (presences) and 0 (absences), representing a first relevé.

plot.im

If TRUE uses image to plot an image of the result. FALSE otherwise.

Value

A listwith three components. Component one ('inc.ide.matrix') contains a square matrix with ncol(m) x ncol(m) where: 0 means that the relevé corresponding to the row is not included in the relevé corresponding to the column; 1 means that the relevé corresponding to the row is included in the relevé corresponding to the column; 2 means that both the relevés corresponding to the row and column are identical and contain exactly the same taxa (i.e. are duplicated or coincidental); they are also reciprocally included in each other; and 3 is the value used in the diagonal of the square matrix (usually not useful; rigorously, relevés are considered included in the sense that each relevé includes itself, or is identical to itself). Component two ('included') gives the pairs of indices of all the included relevés in m (the first one is included in the second one), except for the cases where the relevés are identical, which indices are returned in component three ('identical'). The optional plot (plot.im = TRUE) will show the different cases graphically.

Details

This function checks, for each relevé (i.e. for each column of m), if it is contained (or not) in any other relevé of the m matrix. When a pair of relevés are mutually included in each other, it means that they are identical relevés (containing exactly the same taxa) so the the function labels both as identical.

Author

Tiago Monteiro-Henriques. E-mail: tmh.dev@icloud.com.