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

is_rel_included(rel1, rel2)

Arguments

rel1

vector A numerical vector of 1 (presences) and 0 (absences), representing a first relevé.

rel2

vector A numerical vector of 1 (presences) and 0 (absences), representing a second relevé.

Value

The function returns 0 if rel1 is not included in rel2; returns 1 if rel1 is included in rel2; and returns 2if both relevés contain exactly the same taxa (duplicated or coincidental).

Details

This function checks if rel1 is included in a second relevé rel2, i.e., if all the taxa that is present in rel1 is also present in rel2. The relevés should come from the same relevé table, thus should have the same length.

Author

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