preproc_check_print <- function(nw, response){
ergm_preprocess_response(nw, response)
str(list(
valued = is.valued(nw),
el = head(as.edgelist(nw, attrname=nw%ergmlhs%"response", output="tibble"),3)
))
}
data(florentine)
preproc_check_print(flomarriage, NULL)
flomarriage %e% "w" <- runif(network.edgecount(flomarriage))
flomarriage %e% "s" <- rep(c(-1,1), length.out=network.edgecount(flomarriage))
# Edge attribute expression
preproc_check_print(flomarriage, ~w*s)
# Named
preproc_check_print(flomarriage, wsprod~w*s)
# Binary from valued
preproc_check_print(flomarriage, ~s>0)
# Default edge attribute mode is valued
flomarriage[,] <- 0 # Empty network
preproc_check_print(flomarriage, ~w*s)
# Force default edge attribute mode to binary
preproc_check_print(flomarriage, ~w|TRUE)
Run the code above in your browser using DataLab