inclusion of birth year in plotted pedigrees
Opened this issue · 2 comments
Hello,
thank you for making kinship2 - i've found the plotting of pedigrees very helpful.
One question i can't seem to resolve is how to incorporate additional information into the plotted pedigrees. For example, i would love to color my plots by year of birth but there doesn't seem to be any way to do this. I know that the plots can be shaded/unshaded by affected status, but this is limited to a 0/1 option as far as i can tell. I have a pedigree that spans several breeding attempts by birds in successive years, and hence colouring each brood by year would be really informative.
Also, i seem to have a couple of issues that i can't explain in my pedigrees. For instance, there's randomly repeated individuals individuals in my pedigrees (e.g. M0046 in the image below) and also the shapes don't correspond to the sexes specified in my pedigree files.
Any suggestions would be much appreciated.
thanks,
D
Beth's example should work for the brood year. Here is an example using "test1" that is created in example(kinship), where I add some text to the id, and birth year on a new line, but I think color might be better. Also, if you re-order the pedigree or look at how to do "hints", you can minimize the need to make extra copies of individuals. Also, for sex/gender, they need to be either 0/1 (1 for female) or 1/2, (2 for female). It gets a little tricky, especially if you have them as character.
R> ped1 <- with(test1, pedigree(id=id, dad, mom, sex))
R> test1$birthYR <- c(1950:1953, 1970:1977, 1995:1996)
R> ped1 <- with(test1, pedigree(id=id, dad, mom, sex))
R> plot(ped1, id=paste0(test1$id, ": <more text> \n ", test1$birthYR), cex=0.8)