-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
This is a exegesis of this question on SO:
library(ergm.multi)
data(florentine, package = "ergm")
plot(flobusiness)
plot(flomarriage)
flo <- Layer(business = flobusiness, marriage = flomarriage)
set.vertex.attribute(flo, attrname = "x", value = 1:32)
flo
# Works
summary(
flo ~ L(~ edges, ~ business) + L(~ edges, ~ marriage)
)
# Works
ergm(
flo ~ L(~ edges, ~ business) + L(~ edges, ~ marriage)
)
# Doesn't work
summary(
flo ~ L(~ edges + nodecov("x"), ~ business) +
L(~ edges + nodecov("x"), ~ marriage)
)
# Error in `ergm_Init_abort()`:
# ! In term ‘nodecov’ in package ‘ergm’ (called from term ‘L’ in package ‘ergm.multi’): ‘x’ is/are not valid nodal attribute(s).
# Run `rlang::last_trace()` to see where the error occurred.Brief debugging suggests that the term initialization function receives the network object stripped of all the attributes, hence x above is not found.
Metadata
Metadata
Assignees
Labels
No labels