The ergm_preprocess_response function takes a character string argument specifying the response of the network to identify which edge covariate to be processed. However, after running this function, the character string gets removed from the environment. Sometimes this won't be an issue because the information about response gets integrated into the network after preprocessing. But it can create issues when this character string indicating the network response needs to be reused later, which can happen when we later call other ergm functions that asks for response string as argument (ergm_model, summary_formula, ergm, ergm_godfather etc.). Here is a toy example demonstrating this issue.
library(network);library(ergm.count)
#configure graph from adjancency matrix
mat <- matrix(nrow = 3, ncol = 3, 0)
mat[1,2] <- 2
mat[2,1] <- 3
mat
net <- network(mat, names.eval = "e", ignore.eval=F)
as.sociomatrix(net, attrname = "e")
#response
response="e"
ergm_preprocess_response(net, response = response)
response #response character was removed
Hello again Pavel,
The
ergm_preprocess_response
function takes a character string argument specifying the response of the network to identify which edge covariate to be processed. However, after running this function, the character string gets removed from the environment. Sometimes this won't be an issue because the information about response gets integrated into the network after preprocessing. But it can create issues when this character string indicating the network response needs to be reused later, which can happen when we later call otherergm
functions that asks for response string as argument (ergm_model
,summary_formula
,ergm
,ergm_godfather
etc.). Here is a toy example demonstrating this issue.This is a followup of issue #459
Thanks!