0

Hello I would create genealogic tree from my data using ggenealogy. I am stacked on the begging, when I try to create igraph. My data (small part).

df<-data.frame(child=c("82Y-02938", "82Y-02939","82Y-02938", "82Y-02939"), parent=c("81Y-02080", "81Y-02439", "81Y-02080", "81Y-02439"))

ig<-dfToIG(dff)

and I get the error Error in igraph::graph.data.frame(d = edges, directed = isDirected, vertices = nodes) : Some vertex names in edge list are not listed in vertex data frame

I have no idea, what is wrong. Thanks for a help

Problem Solved

It is necessery to have also parents in child (=vertex) column and for them to have NA as parents.

df<-data.frame(child=c("82Y-02938", "82Y-02939","82Y-02938", "82Y-02939","81Y-02080", "81Y-02439"), parent=c("81Y-02080", "81Y-02439", "81Y-02080", "81Y-02439",NA,NA))

0 Answers0