# Creating a random graph
set.seed(881)
diffnet <- rdiffnet(100, 5, seed.graph="small-world")
# 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)
)
)
# Concatenating results
c(res, res)
# Running in parallel fashion
## Not run:
# res <- struct_test(diffnet, function(g) mean(threshold(g), na.rm=TRUE), R=100,
# ncpus=4, parallel="multicore")
# res
# hist(res)
# ## End(Not run)
Run the code above in your browser using DataLab