I have a problem with the following procedure:
library(igraph)
k <- cbind(c(.2,.2),c(.2,0))
sbm_centr <- replicate(
2000,
sample_sbm(49, pref.matrix = k, block.sizes = c(24, 25)) %>%
centr_degree(.)$centralization
)
The issue is that the function generates a result with two arguments (in addition to the ID of each replication), so the procedure reports an error: Error in .$centr_degree(.) : 3 arguments passed to '$' requiring 2"
I tried, unsuccessfully, to save one of the arguments with the following expression: centr_degree(.)$centralization[1])
But the list contains only 0s. Thanks in advance for your comments.