Calculate one of several measures of mating compatibility.
compatibility(scene, method, subject = "all", averageType = "mean")A potentials object containing one more more of the following, depending the
input for subject:
If subject is "population" the return list will contain a numeric
value that has a range depending on the method. If
subject is "pair" the return list will contain a matrix
with all pairwise compatibilities. If subject is "individual"
the return list will contain a dataframe with a column containing IDs and
a column containing compatibility averages. If subject is "all"
the return list will contain all three of the items above.
a matingScene object
either "si_echinacea" or "dioecious" see details for further description
whether you want pair, individual, population, or all. Specifying more than one is allowed.
whether to calculate individual and population proximity using the mean or median
Danny Hanson
When method is "si_echinacea" compatibility will be
calculated as sporophytic self incompatible (si) in the same manner as Echinacea
(and many other plants). For two individuals, they are incompatible if
they share any S alleles (columns s1 and s2) and they compatible otherwise.
When method is "dioecious" it is assumed that the column s1 will
contain either a 1 or 2 depending on the individual's sex. Thus, when
comparing two individuals, they are compatible if s1 of the first != s1
of the second, and s2 is ignored.
pop <- simulateScene()
compatibility(pop, "si_echinacea")
Run the code above in your browser using DataLab