tilltnet / egor

R Package for importing and analysing ego-centered-network data.
http://egor.tillt.net
GNU Affero General Public License v3.0
23 stars 4 forks source link

as.network(egor) doesn't work. #67

Closed krivit closed 3 years ago

krivit commented 3 years ago

This should produce a list of egonets. Instead, it produces an error:

library(ergm.ego)
data(faux.mesa.high)
fmh.ego <- as.egor(faux.mesa.high)
aaa <- as.network(fmh.ego)
#> Error in as.data.frame.default(.): cannot coerce class '"function"' to a data.frame

Created on 2021-06-26 by the reprex package (v2.0.0)

mbojan commented 3 years ago

There is a bug in

https://github.com/tilltnet/egor/blob/8d1b3e144d01b902ac2498835cc5ab75cf597cf2/R/conversions.R#L241

when running @krivit code above. The if() is skipped and no el created which is used in the pipe in the next line. el() is a function in methods package so it gets piped to as.data.frame() and hence the error.

tilltnet commented 3 years ago

@krivit can you please test if it is now working as you'd expect. Seems good on my end. I'll look int #68 and submit to CRAN as soons as both issues are fixed.