# Calculating the exposure based on Structural Equivalence ------------------
set.seed(113132)
graph <- rdiffnet(100, 10)
SE <- lapply(struct_equiv(graph), "[[", "SE")
SE <- lapply(SE, function(x) 1/(x + 1e-15))
eSE <- exposure(graph, alt.graph=SE)
eNO <- exposure(graph)
any(eSE != eNO) # Different outputs
# Weighted Exposure using degree --------------------------------------------
eDE <- exposure(graph, attrs=dgr(graph))
any(eNO != eDE) # Different outputs
# Comparing using incomming edges -------------------------------------------
eIN <- exposure(graph, outgoing=FALSE)
any(eIN != eNO) # Different outputs
Run the code above in your browser using DataLab