I am using code from this post: Order of treechart entries not correct in R igraph package
The code does not work if labels are all / mostly numeric:
111
222
333
99
1010
44
55
66
1111
1313
1414
1515
77
88
1212
Following is the error:
Error in if (vr[1] == vr[2]) { : missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
2: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
3: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
4: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
5: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
6: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
7: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
8: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
9: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
10: In mean.default(sapply(nb, function(x) calcypos(g, x))) :
argument is not numeric or logical: returning NA
>
The 'edges' dataframe in code is being made all right (I checked with print(edges)). How can I solve this problem? Thanks for your help.