R: An R Package for Extended Behavior Genetics Analysis

# An R Package for Extended Behavior Genetics Analysis

## Documentation for package ‘BGmisc’ version 1.2.0

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

adjustKidsPerCouple | Generate or Adjust Number of Kids per Couple Based on Mating Rate
allGens | allGens A function to calculate the number of individuals in each generation. This is a supporting function for 'simulatePedigree'.
assignCoupleIds | Assign Couple IDs
buildBetweenGenerations | Process Generation Connections
buildWithinGenerations | Process Generations for Pedigree Simulation
calculateRelatedness | Calculate Relatedness Coefficient
checkIDs | Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe
checkSex | Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe
comp2vech | comp2vech Turn a variance component relatedness matrix into its half-vectorization
createGenDataFrame | Create Data Frame for Generation
determineSex | Determine Sex of Offspring
dropLink | dropLink A function to drop a person from his/her parents in the simulated pedigree 'data.frame'. The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to-be-dropped person is in. The function can separate one pedigree into two pedigrees. Separating into small pieces should be done by running the function multiple times. This is a supplementary function for 'simulatePedigree'.
evenInsert | evenInsert A function to insert m elements evenly into a length n vector.
famSizeCal | famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function 'simulatePedigree'
fitComponentModel | fitComponentModel Fit the estimated variance components of a model to covariance data
hazard | Simulated pedigree with two extended families and an age-related hazard
identifyComponentModel | identifyComponentModel Determine if a variance components model is identified
inbreeding | Artificial pedigree data on eight families with inbreeding
inferRelatedness | Infer Relatedness Coefficient
makeInbreeding | makeInbreeding A function to create inbred mates in the simulated pedigree 'data.frame'. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for 'simulatePedigree'.
makeTwins | makeTwins A function to impute twins in the simulated pedigree 'data.frame'. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for 'simulatePedigree'.
markPotentialChildren | Mark and Assign children
ped2add | Take a pedigree and turn it into an additive genetics relatedness matrix
ped2ce | Take a pedigree and turn it into an extended environmental relatedness matrix
ped2cn | Take a pedigree and turn it into a common nuclear environmental relatedness matrix
ped2com | Take a pedigree and turn it into a relatedness matrix
ped2fam | Add an extended family ID variable to a pedigree
ped2graph | Turn a pedigree into a graph
ped2maternal | Add a maternal line ID variable to a pedigree
ped2mit | Take a pedigree and turn it into a mitochondrial relatedness matrix
ped2mt | Take a pedigree and turn it into a mitochondrial relatedness matrix
ped2paternal | Add a paternal line ID variable to a pedigree
plotPedigree | plotPedigree A wrapped function to plot simulated pedigree from function 'simulatePedigree'. This function require the installation of package 'kinship2'.
potter | Fictional pedigree data on a wizarding family
relatedness | relatedness (Deprecated)
related_coef | related_coef (Deprecated)
repairIDs | Repair Missing IDs
repairSex | Repairs Sex Coding in a Pedigree Dataframe
resample | Resample Elements of a Vector
SimPed | SimPed (Deprecated)
simulatePedigree | Simulate Pedigrees This function simulates "balanced" pedigrees based on a group of parameters: 1) k - Kids per couple; 2) G - Number of generations; 3) p - Proportion of males in offspring; 4) r - Mating rate.
sizeAllGens | sizeAllGens An internal supporting function for 'simulatePedigree'.
vech | vech Create the half-vectorization of a matrix