score_mate: Score Mate

Description Usage Arguments Value Examples

View source: R/score_mate.R

Description

Score the mating of a single female and male.
Apply this function to multiple matings using the rank_mates function.

Usage

1
score_mate(DB, female, male, type, bonus = NULL, weighted_alleles = NULL)

Arguments

DB

RSQLite database generated by make_database

female

Sample ID of the female to compare to a male. The Sample ID must match the ones found in the DB.

male

Sample ID of the male to compare to a female. The Sample ID must match the ones found in the DB.

type

The type of mating that is advantageous.

  1. all_alleles: the user specifies for each locus what is advantageous.

  2. assortive: Assortive (same alleles) is advantageous for all loci

  3. disassortive: Disassortive (different alleles) is advantageous for all loci

bonus

Numeric value to increase mating score if the state of alleles specified in weighted_alleles are met. If you specify .15 as your bonus, and 2/3 of your loci match the advantageous, then .10 will be used as the bonus. The final score will be increased by 10%. Must specify weighted_alleles.

weighted_alleles

vector listing allele IDs to calculate the bonus. Must specify bonus.

Value

dataframe

Examples

1
2
3
4
5
6
## Not run: 
single <- score_mate(DB = DB, female = female,
                     male = male, type = type,
                     bonus=bonus, weighted_alleles=weighted_alleles)

## End(Not run)

danagibbon/MultifacitedChoice documentation built on Dec. 31, 2020, 11:10 p.m.