BGmisc1.5.2 package

An R Package for Extended Behavior Genetics Analysis

process_one

Convert Sparse Relationship Matrices to Kinship Links for one Matrix

process_tag

Process a GEDCOM Tag

processEventLine

Process Event Lines (Birth or Death)

processParents

Process Parents Information from GEDCOM Data

readGedcom

Read a GEDCOM File

readWikifamilytree

Read Wiki Family Tree

recodeSex

Recodes Sex Variable in a Pedigree Dataframe

repairIDs

Repair Missing IDs

repairParentIDs

Repair Parent IDs

repairSex

Repairs Sex Coding in a Pedigree Dataframe

resample

Resample Elements of a Vector

rmvn

rmvn

simulatePedigree

Simulate Pedigrees This function simulates "balanced" pedigrees based ...

sliceFamilies

sliceFamilies

splitIndividuals

Split GEDCOM Lines into Individual Blocks

standardizeColnames

Standardize Column Names in a Dataframe (Internal)

summarizeFamilies

Summarize the families in a pedigree

summarizeFounder

Function to summarize the originating members for each line

summarizeMatrilines

Summarize the maternal lines in a pedigree

summarizeOldest

Function to summarize the oldest individuals in a pedigree

summarizePatrilines

Summarize the paternal lines in a pedigree

summarizePedigrees

Summarize Pedigree Data

traceTreePaths

Trace paths between individuals in a family tree grid

tryNA

modified tryCatch function

validate_and_convert_matrix

validate_and_convert_matrix

vech

vech Create the half-vectorization of a matrix

addParentRow

Create a properly formatted parent row for the pedigree

addPersonToPed

addPersonToPed

addRowlessParents

Add addRowlessParents

adjustKidsPerCouple

Generate or Adjust Number of Kids per Couple Based on Mating Rate

applyTagMappings

Apply Tag Mappings to a Line

assignCoupleIDs

Assign Couple IDs

BGmisc-package

BGmisc: An R Package for Extended Behavior Genetics Analysis

buildBetweenGenerations

Process Generation Connections

buildTreeGrid

Parse Tree

buildWithinGenerations

Process Generations for Pedigree Simulation

calcAllGens

calcAllGens A function to calculate the number of individuals in each ...

calcFamilySize

calcFamilySize A function to calculate the total number of individuals...

calcFamilySizeByGen

calcFamilySizeByGen An internal supporting function for `simulatePedig...

calculateCIs

Confidence Intervals for Correlations with Optional Design-Effect Adju...

calculateH

Falconer's Formula

calculateRelatedness

Calculate Relatedness Coefficient

calculateSummaryDT

Function to calculate summary statistics for all numeric variables Thi...

checkIDs

Validates and Optionally Repairs Unique IDs in a Pedigree Dataframe

checkIDuniqueness

Check for duplicated individual IDs

checkParentIDs

Validates and Optionally Repairs Parent IDs in a Pedigree Dataframe

checkParentSex

Check Parental Role Sex Consistency

checkPedigreeNetwork

Validate Pedigree Network Structure

checkSex

Validates and Optionally Repairs Sex Coding in a Pedigree Dataframe

checkWithinRowDuplicates

Check for within-row duplicates (self-parents, same mom/dad)

collapseNames

collapse Names

com2links

Convert Sparse Relationship Matrices to Kinship Links

combine_columns

Combine Columns

comp2vech

comp2vech Turn a variance component relatedness matrix into its half-v...

computeParentAdjacency

Compute Parent Adjacency Matrix with Multiple Approaches

convertGrid2LongTree

Make Long Tree

countPatternRows

Count GEDCOM Pattern Rows

createGenDataFrame

Create Data Frame for Generation

deduplicatePairs

Deduplicate pairs of IDs in a data frame

determineSex

Determine Sex of Offspring

dot-adjBeta

Construct Adjacency Matrix for Parent-Child Relationships Using Beta M...

dot-adjDirect

Construct Adjacency Matrix for Parent-Child Relationships Using Direct...

dot-adjIndexed

Construct Adjacency Matrix for Parent-Child Relationships Using Indexe...

dot-adjLoop

Construct Adjacency Matrix for Parent-Child Relationships

dot-assignParentValue

Assign parent values based on component type

dot-collapseNames.legacy

collapse Names

dot-com2links.legacy

Convert Sparse Relationship Matrices to Kinship Links

dot-com2links.og

Convert Pedigree Matrices to Related Pairs File (Legacy)

dot-combine_columns.legacy

Combine Columns

dot-computeTranspose

Compute the transpose multiplication for the relatedness matrix

dot-countPatternRows.legacy

Check for Pattern Rows

dot-extract_info.legacy

Extract Information from Line

dot-fisherz

Fisher's r to z transformation and back

dot-fisherz2r

Fisher's r to z transformation and back

dot-getModalValue

Get the Modal Value of a Vector

dot-loadOrComputeInverseDiagonal

Load or compute the inverse diagonal matrix

dot-loadOrComputeIsChild

Load or compute the isChild matrix

dot-loadOrComputeIsPar

Load or compute the isPar matrix

dot-loadOrComputeParList

parent-child adjacency data

dot-mapFAMC2parents.legacy

Assign momID and dadID based on family mapping

dot-mapFAMS2parents.legacy

Create a mapping of family IDs to parent IDs

dot-postProcessGedcom.legacy

Post-process GEDCOM Data Frame

dot-process_tag.legacy

Process a GEDCOM Tag

dot-processParents.legacy

Process parents information

dot-readGedcom.legacy

Read a GEDCOM File

dropLink

dropLink

efunc

Error Function

extract_info

Extract Information from Line

extractMemberTable

Match Members

findBiggest

Function to find the biggest families in a pedigree This function find...

findFooest

Function to find the most extreme individuals in a pedigree This funct...

findFounder

Function to find the originating member for each line

findOldest

Function to find the oldest individuals in a pedigree This function fi...

fitComponentModel

fitComponentModel Fit the estimated variance components of a model to ...

getGridNeighbors

Build adjacency list (4-way neighbors)

getWikiTreeSummary

Extract Summary Text

identifyComponentModel

identifyComponentModel Determine if a variance components model is ide...

inferRelatedness

Infer Relatedness Coefficient

initialize_empty_df

initialize_empty_df

initializeCheckpoint

Initialize checkpoint files

initializeRecord

Initialize an Empty Individual Record

insertEven

evenInsert A function to insert m elements evenly into a length n vect...

isChild

Determine isChild Status, isChild is the 'S' matrix from RAM

loadOrComputeCheckpoint

Load or compute a checkpoint

makeInbreeding

makeInbreeding

makeTwins

makeTwins

mapFAMC2parents

Assign momID and dadID based on family mapping

mapFAMS2parents

Create a Mapping from Family IDs to Parent IDs

markPotentialChildren

Mark and Assign children

Null

Compute the null space of a matrix

null2NA

nullToNA

parseIndividualBlock

Parse a GEDCOM Individual Block

parseNameLine

Parse Name Line

parseTreeRelationships

infer relationship from tree template

ped2add

Take a pedigree and turn it into an additive genetics relatedness matr...

ped2ce

Take a pedigree and turn it into an extended environmental relatedness...

ped2cn

Take a pedigree and turn it into a common nuclear environmental matrix

ped2com

Take a pedigree and turn it into a relatedness matrix

ped2fam

Segment Pedigree into Extended Families

ped2gen

Take a pedigree and turn it into a generation relatedness matrix

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

ped2paternal

Add a paternal line ID variable to a pedigree

populateParents

Assign Parent

postProcessGedcom

Post-process GEDCOM Data Frame

prepSummarizePedigrees

Function to prepare the pedigree for summarization This function prepa...

Provides functions for behavior genetics analysis, including variance component model identification [Hunter et al. (2021) <doi:10.1007/s10519-021-10055-x>], calculation of relatedness coefficients using path-tracing methods [Wright (1922) <doi:10.1086/279872>; McArdle & McDonald (1984) <doi:10.1111/j.2044-8317.1984.tb00802.x>], inference of relatedness, pedigree conversion, and simulation of multi-generational family data [Lyu et al. (2024) <doi:10.1101/2024.12.19.629449>]. For a full overview, see [Garrison et al. (2024) <doi:10.21105/joss.06203>].

  • Maintainer: S. Mason Garrison
  • License: GPL-3
  • Last published: 2026-01-11