Thursday, April 11, 2013

RG#51: Pedigree chart / plot

pedt <- data.frame( inames = 1:11,
 dad_id=c( 0, 0, 0, 0, 1, 1, 1, 3, 3, 5, 5),
 mom_id=c( 0, 0, 0, 0, 2, 2, 2, 4, 4, 6, 6),
 sex=c( 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1),
 affst=c(1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1))


#plot
library(kinship)
pedout <- with(pedt, pedigree(id= inames, dadid=dad_id, momid=mom_id, sex=sex,
affected=affst), col = "red")

plot(pedout)



 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.