Closed marioangst closed 6 years ago
Thanks for the report. It looks like it's working in the current master branch. Can you try installing that and seeing if you can reproduce the problem?
Since I can't reproduce the problem, I am going to assume that it's been fixed in master
.
Line 58 in https://github.com/statnet/ergm.ego/blob/master/R/degreedist.R: degtable[as.numeric(names(table(egodata$alters[egoIDcol])))] <- table(egodata$alters[egoIDcol])
is problematic if names(table(egodata$alters[egoIDcol])) are not numbers as this produces NAs (if egoIDs are given as Not a big problem as the "as.numeric" can be easily removed in this case, but an update would be appreciated.
A minimal reproducible example:
egonet <- as.egodata.data.frame(object = data.frame(egoid = c("A","B","C")), alters = data.frame(egoid = c("A","A","B","C","C","C")), egoIDcol = "egoid") degreedist.egodata(egonet)