You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onefile_to_egor seems to be very fragile to the column order in the input data frame. Consider the following input data frame which is two rows from GSS 2004:
# add a variable at the enddd$foobar<-1e<- with(
dd,
onefile_to_egor(
egos=dd,
pmin(numgiven,5),
ID.vars=list(ego="id"),
attr.start.col="sex1",
attr.end.col="sex5",
max.alters=5,
aa.first.var="close12",
aa.regex="^(?<attr>[[:alpha:]]+)(?<src>[[:digit:]])(?<tgt>[[:digit:]])$"
)
)
which gives
Error in `[.data.frame`(e.wide, -nm) : object 'nm' not found
It seems that the functions is interpreting the new foobar column as giving information on alter-alter ties.
I'm not yet sure what's the best way to address it, probably one of:
Write in the documentation that the input data frame has to have variables and blocks of variables in specific order (e.g. alter-alter variables last)
Modify the function so that the user will need to specify variable names for all alter and alter-alter variable block explicitly. E.g. something like f( aattrs=list(sex = "sex[0-9]"), aaties = list(close = "close[0-9]{2}") ) ....
Give up on trying to support every possible variation in which ppl may store egocentric data and provide constructor functions only for, say, (1) long format and (2) separate dataframes...
The text was updated successfully, but these errors were encountered:
onefile_to_egor
seems to be very fragile to the column order in the input data frame. Consider the following input data frame which is two rows from GSS 2004:I can create
egor
object from that withbut it will fail if I add a variable at the end:
which gives
It seems that the functions is interpreting the new
foobar
column as giving information on alter-alter ties.I'm not yet sure what's the best way to address it, probably one of:
f( aattrs=list(sex = "sex[0-9]"), aaties = list(close = "close[0-9]{2}") )
....The text was updated successfully, but these errors were encountered: