create.network: Create networks

Description Usage Arguments Value Note Author(s) References Examples

Description

Create networks

Usage

1
create.network(n = 100, type = "barabasi", edge.weights = NULL, m = 2, p.or.m = (2 * n - 2 * floor(sqrt(n))),...)

Arguments

n
type
edge.weights
m

parameter of barabasi.game().

p.or.m

parameter of erdos.renyi.game().

...

Value

bla bla bla

Note

bla

Author(s)

Florian Markowetz

References

http://www.markowetzlab.org/software

Examples

 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)
  }

nea documentation built on May 2, 2019, 5:52 p.m.