Description Usage Arguments Examples
Return randomized binary network with the same density as the initial network. Loops are not assumed. The randomized network is asymmetric.
1 | randomize(network)
|
network |
the binary network, of class |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
randomize <- function(network){
random <- matrix(sample(network), nrow = nrow(network))
ndiag <- sum(diag(random))
diag(random) <- -1
random[sample(which(random == 0), replace = F, size = ndiag)] <- 1
diag(random) <- 0
return(random)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.