[R] gen.geneaslogy

Thomas Bolger tom@bo|ger @end|ng |rom ucd@|e
Thu Aug 8 16:11:50 CEST 2019


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]]



More information about the R-help mailing list