Description Usage Arguments Value Note Author(s) References Examples
Create networks
1 |
n |
|
type |
|
edge.weights |
|
m |
parameter of barabasi.game(). |
p.or.m |
parameter of erdos.renyi.game(). |
... |
bla bla bla
bla
Florian Markowetz
http://www.markowetzlab.org/software
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | y=1
x=2
x+y
## The function is currently defined as
function (n = 100, type = "barabasi", edge.weights = NULL, ...)
{
if (!type %in% c("barabasi", "erdos.renyi", "grid"))
stop("Input 'type' unknown: Stop feeding me crap!")
g <- switch(type, barabasi = barabasi.game(n, directed = FALSE,
...), erdos.renyi = erdos.renyi.game(n, p.or.m = (2 *
n - 2 * floor(sqrt(n))), type = "gnm", directed = FALSE,
...), grid = create.grid(n))
if (is.null(edge.weights) || edge.weights == 0)
E(g)$weight <- sample(1:10, length(E(g)), replace = TRUE)
else E(g)$weight <- edge.weights
return(g)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.