I am trying to plot very simple pedigrees with kinship2. I only have one generations but lots of different families.
id <- sample(1:100, 50, replace=F)
dadid <- sample(100:110, 50, replace=T)
momid <- sample(111:121, 50, replace=T)
sex <- sample(1:3, 50, replace=T)
df <- data.frame(cbind(dadid, momid, id, sex))
df<- df %>% mutate(famid = group_indices(., momid, dadid))
When I try and convert my data into a pedigree() object:
pedAll <- pedigree(
id = id,
dadid = dadid,
momid = momid,
sex = sex,
famid = famid)
I get the following error:
Error in pedigree(id = id, dadid = dadid, momid = momid, sex = sex, famid = famid) :
Value of 'dadid' not found in the id list 1/101 5/100 5/103 11/103 11/107
Any ideas why? I have been doing round in circles for ages and there is not much out there using this package.