Learn R Programming

mateable (version 0.3.1)

compatibility: Make potentials object--mating type compatibility

Description

Calculate one of several measures of mating compatibility.

Usage

compatibility(scene, method, subject = "all", averageType = "mean")

Arguments

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

Value

  • 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.

Details

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.

Examples

Run this code
pop <- simulateScene()
compatibility(pop, "si_echinacea")

Run the code above in your browser using DataLab