Skip to content

Instantly share code, notes, and snippets.

@zx8754
Created January 24, 2024 09:51
Show Gist options
  • Save zx8754/ff0e6ea629f05a9f77fd003b909318e7 to your computer and use it in GitHub Desktop.
Save zx8754/ff0e6ea629f05a9f77fd003b909318e7 to your computer and use it in GitHub Desktop.
SO_77868111
#https://stackoverflow.com/q/77868111/680068
library(kinship2)
d <- read.table(text="
FAMID,ID,MO,FA,SEX,AGE,BIRTH
F0001,C1,,,2,32,
,C2,,,1,34,
,C3,C1,C2,1,12,
F0002,C4,,,2,44,
,C5,C4,Q1,1,13,
,C6,C4,Q1,1,12,
,Q1,,,1,,
",header = TRUE, sep = ",", na.strings = "")
pp <- pedigree(
id = d$ID,
momid = d$MO,
dadid = d$FA,
sex = d$SEX)
plot(pp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment