library(kinship)
# generate an example data
id <- 1:14
dadid <- c(NA, NA, 1, 1, 1, 3, 5, NA, NA, 8, 8, NA, NA, 11)
momid <- c(NA, NA, 2, 2, 2, 12, 13, NA, NA, 9, 9, NA, NA, 4)
sex <- c(1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1)
affected <-c(1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1)
status <-c(0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0)
# make it a data frame
ped <- data.frame(id, dadid, momid, sex, affected, status)
# pedigree analysis
pp<-pedigree(id=ped$id,dadid=ped$dadid,momid=ped$momid,sex=ped$sex,affected=ped$affected,status=ped$status)
# pedigree plot
plot(pp)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment