paternity: Estimates fractional paternity probability

Description Usage Arguments Value Author(s) Examples

View source: R/paternity.R

Description

This function estimates fractional paternity for offspring given a set of potential fathers.

Usage

1
2
3
4
5
6
7
8
paternity(
  offspring,
  mother,
  fathers,
  ID = "ID",
  OffID = "OffID",
  strict = FALSE
)

Arguments

offspring

A particular offspring. Often as a row from a data.frame with columns as loci and other meta data.

mother

The assumed mother of the offspring as a row from a data.frame with columns as loci and other meta data.

fathers

A data.frame of potential fathers.

ID

The name of the column where the dad's adult ID column is found in the data.frame of potential fathers.

OffID

The name of the column where the offspring ID is located. All offspring from a maternal individual should have have the same maternal ID to indicate which mother they are from but must also have a unique offspring ID.

strict

A flag (default=FALSE) to use strict paternity (e.g., where only one dad can be the father) versus fractional paternity (e.g., where potentially more than one father is assignable but whose likelihood is based upon their transition probabilities).

Value

A data.frame with indications of paternity by row. Columns will include ID, OffID, DadID, and potentially Fij.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
freqs <- c(1/3,1/3,1/3)
loci <- rep( paste("Loc",1:6,sep="-"), each=3)
alleles <- LETTERS[1:3]
f <- data.frame(Locus=loci, Allele=alleles, Frequency=freqs)
f
adults <- make_population(f,N=20)
adults
offs <- mate( adults[1,], adults[2,], N=10)
offs$OffID <- offs$ID
offs$MomID <- adults$ID[1]
paternity( offs, adults[1,], adults )

MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.