Hi I have just started to do some analysis of genealogies and seem to be doing something wrong when using gen.genealogy. The following is the script and output that I used. Any help greatfully apprciated library(GENLIB)> library(ggenealogy) > library(igraph) > # > # > ###Data input as data frame >ind<-c(501,502,601,603,605,608,701,702,703,704,705,706,707,708,709,710,801,802)>father<-c(401,411,501,501,501,501,601,601,601,603,603,603,605,605,608,608,701,701)>mother<-c(402,412,502,502,502,502,602,602,602,604,604,604,606,607,609,609,711,711)> sex<-c(1,2,1,1,1,1,2,2,1,2,1,2,1,1,1,1,1,2) > gen.df<-data.frame(ind, father, mother, sex) > #print data to check > print (gen.df)ind father mother sex 1 501 401 402 1 2 502 411 412 2 3 601 501 502 1 4 603 501 502 1 5 605 501 502 1 6 608 501 502 1 7 701 601 602 2 8 702 601 602 2 9 703 601 602 1 10 704 603 604 2 11 705 603 604 1 12 706 603 604 2 13 707 605 606 1 14 708 605 607 1 15 709 608 609 1 16 710 608 609 1 17 801 701 711 1 18 802 701 711 2> # > # > genex<-gen.genealogy(gen.df)Error in gen.genealogy(gen.df) : Invalid 'gen' parameter: identical individual number for both 'father' and 'mother'> # >-- Thomas Bolger Emeritus Full Professor of Zoology UCD School of Biology and Environmental Science Belfield Dublin 4 Ireland Telephone : +353-1-7162330 [[alternative HTML version deleted]]
This is a rather specialized issue... you probably should be cc'ing the package maintainer as added here. I have never used this package.. but perhaps the fact that 701 is female yet listed as a father of 801 and 802 could be causing problems. (If so, this may raise issues of family structure flexibility, though it could be appropriate for genetics studies.) On August 8, 2019 7:11:50 AM PDT, Thomas Bolger <tom.bolger at ucd.ie> wrote:>Hi > >I have just started to do some analysis of genealogies and seem to be >doing >something wrong when using gen.genealogy. The following is the script >and >output that I used. Any help greatfully apprciated > >library(GENLIB) >> library(ggenealogy) >> library(igraph) >> # >> # >> ###Data input as data frame >> >ind<-c(501,502,601,603,605,608,701,702,703,704,705,706,707,708,709,710,801,802) >> >father<-c(401,411,501,501,501,501,601,601,601,603,603,603,605,605,608,608,701,701) >> >mother<-c(402,412,502,502,502,502,602,602,602,604,604,604,606,607,609,609,711,711) >> sex<-c(1,2,1,1,1,1,2,2,1,2,1,2,1,1,1,1,1,2) >> gen.df<-data.frame(ind, father, mother, sex) >> #print data to check >> print (gen.df) > ind father mother sex >1 501 401 402 1 >2 502 411 412 2 >3 601 501 502 1 >4 603 501 502 1 >5 605 501 502 1 >6 608 501 502 1 >7 701 601 602 2 >8 702 601 602 2 >9 703 601 602 1 >10 704 603 604 2 >11 705 603 604 1 >12 706 603 604 2 >13 707 605 606 1 >14 708 605 607 1 >15 709 608 609 1 >16 710 608 609 1 >17 801 701 711 1 >18 802 701 711 2 >> # >> # >> genex<-gen.genealogy(gen.df) >Error in gen.genealogy(gen.df) : > Invalid 'gen' parameter: identical individual number for both 'father' >and 'mother' >> # >>-- Sent from my phone. Please excuse my brevity.
Hi Many thanks for your very quick response. I should have spotted the error in the data. I have corrected it but the error remains. Hopefully. the package maintainer will be able to help. Thank you very much for your reply. Tom On Thu, 8 Aug 2019 at 15:57, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:> This is a rather specialized issue... you probably should be cc'ing the > package maintainer as added here. > > I have never used this package.. but perhaps the fact that 701 is female > yet listed as a father of 801 and 802 could be causing problems. (If so, > this may raise issues of family structure flexibility, though it could be > appropriate for genetics studies.) > > On August 8, 2019 7:11:50 AM PDT, Thomas Bolger <tom.bolger at ucd.ie> wrote: > >Hi > > > >I have just started to do some analysis of genealogies and seem to be > >doing > >something wrong when using gen.genealogy. The following is the script > >and > >output that I used. Any help greatfully apprciated > > > >library(GENLIB) > >> library(ggenealogy) > >> library(igraph) > >> # > >> # > >> ###Data input as data frame > >> > > >ind<-c(501,502,601,603,605,608,701,702,703,704,705,706,707,708,709,710,801,802) > >> > > >father<-c(401,411,501,501,501,501,601,601,601,603,603,603,605,605,608,608,701,701) > >> > > >mother<-c(402,412,502,502,502,502,602,602,602,604,604,604,606,607,609,609,711,711) > >> sex<-c(1,2,1,1,1,1,2,2,1,2,1,2,1,1,1,1,1,2) > >> gen.df<-data.frame(ind, father, mother, sex) > >> #print data to check > >> print (gen.df) > > ind father mother sex > >1 501 401 402 1 > >2 502 411 412 2 > >3 601 501 502 1 > >4 603 501 502 1 > >5 605 501 502 1 > >6 608 501 502 1 > >7 701 601 602 2 > >8 702 601 602 2 > >9 703 601 602 1 > >10 704 603 604 2 > >11 705 603 604 1 > >12 706 603 604 2 > >13 707 605 606 1 > >14 708 605 607 1 > >15 709 608 609 1 > >16 710 608 609 1 > >17 801 701 711 1 > >18 802 701 711 2 > >> # > >> # > >> genex<-gen.genealogy(gen.df) > >Error in gen.genealogy(gen.df) : > > Invalid 'gen' parameter: identical individual number for both 'father' > >and 'mother' > >> # > >> > > -- > Sent from my phone. Please excuse my brevity. >-- Thomas Bolger Emeritus Full Professor of Zoology UCD School of Biology and Environmental Science Belfield Dublin 4 Ireland Telephone : +353-1-7162330 [[alternative HTML version deleted]]