# Creating a random graph
set.seed(881)
diffnet <- rdiffnet(100, 10)
# Testing structure-dependency of threshold
res <- struct_test(diffnet, function(g) mean(threshold(g), na.rm=TRUE), R=100)
res
hist(res)
# Adding a legend
legend("topright", bty="n",
legend=c(
expression(t[0]:~Baseline),
expression(t:~Rewired~average)
)
)
# Running in parallel fashion
res <- struct_test(diffnet, function(g) mean(threshold(g), na.rm=TRUE), R=100,
ncpus=4, parallel="multicore")
res
hist(res)
Run the code above in your browser using DataLab