bad_parents: Determines of the indicated parent can possibly be the parent...

View source: R/bad_parents.R

bad_parentsR Documentation

Determines of the indicated parent can possibly be the parent of the offspring

Description

This function takes a data.frame full of parents and offspring and checks to see if the offspring are actually assigned to a compatible adult.

Usage

bad_parents(df, AdultID = "ID", OffID = "OffID", verbose = FALSE)

Arguments

df

A data.frame with identification and locus columns.

AdultID

The column header for id of the adults. All adults have unique identification numbers and all offspring have the the same number as the maternal/paternal individual from which they were sampled or are being compared. Default = "ID"

OffID

A column indicating offspring identification numbers. By default all adults have OffID=0 (this is how I tell if they are really adults and not offspring), and all offspring have OffID != 0. Default = "OffID"

verbose

Print out mismatched parent/offspring pairs.

Value

The data.frame with a new column, Is.Parent with values of TRUE/FALSE/NA (the NA is for adults).


dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.