This function analyzes a pedigree and prints a comprehensive summary including counts of individuals, generational structure, sex distribution.

pedigree_summary(ped)

Arguments

ped

A data frame containing pedigree information with columns:

  • id: Unique identifier for each individual

  • mother: ID of the individual's mother (0 for unknown/founder)

  • father: ID of the individual's father (0 for unknown/founder)

  • sex: Character ("F" or "M")

  • generation: Integer indicating the generation number

Value

NULL (prints summary to console). The summary includes:

  • Total number of individuals

  • Distribution of individuals across generations

  • Sex distribution

Examples

# Generate a pedigree and view its summary
ped <- simulate_pedigree(n_founders = 10, n_generations = 3)
pedigree_summary(ped)
#> Pedigree Summary
#> ================
#> Total individuals: 26 
#> 
#> Individuals per generation:
#> 
#>  0  1  2  3 
#> 10  7  6  3 
#> 
#> Sex distribution:
#> 
#>  F  M 
#> 16 10