View source: R/compatibility.R
| compatibility | R Documentation | 
Calculate one of several measures of mating compatibility.
compatibility(scene, method, subject = "all", averageType = "mean")
| scene | a matingScene object | 
| method | either "si_echinacea" or "dioecious" see details for further description | 
| subject | whether you want pair, individual, population, or all. Specifying more than one is allowed. | 
| averageType | whether to calculate individual and population proximity using the mean or median | 
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.
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.
Danny Hanson
pop <- simulateScene()
compatibility(pop, "si_echinacea")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.