When using a vector of length n.nodes to constrain the minimum in- or outdegree, the ergm function throws an error. This does not happen for maxin or maxout.
Looks like a longstanding bug that was exposed by R 4.3.0's || and && now raising an error if given a vector of length greater than 1. Thanks for the report!
When using a vector of length n.nodes to constrain the minimum in- or outdegree, the ergm function throws an error. This does not happen for maxin or maxout.
This minimally reproducible example:
ergm(network(10, directed = T) ~ edges, constraint=~bd(minin=rep(1,10)))
results in the following error:
Error in is.na(a$minout) && is.na(a$minin): 'length = 10' in coercion to 'logical(1)'
I believe the problem lies in the way missing values are assessed.
I used ergm version 4.4.0, R Studio 2023.03.1, and R version 4.3.0.