sim_traits_nets_par: Simulate networks, with interactions propoprtional to trait...

Description Usage Arguments Value Examples

View source: R/sim_traits_nets_par.r

Description

Simulate networks, with interactions propoprtional to trait matching

Usage

1
2
3
4
5
  sim_traits_nets_par(listoftraitvecs, type = NULL,
    traitm = NULL, matdir = "~",
    method = c("complementarity", "barrier", "twomethods"),
    includetraitvar = FALSE, value = NULL,
    output = "matrix")

Arguments

listoftraitvecs

Nested list of trait vectors.

type

Balanced ("bal") or unbalanced ("unbal").

traitm

Evolutionary model, used to create file name, one of "bm", "ou", or "eb".

matdir

directory to put matrices in

method

The model to be used to construct interaction matrices. One of "complementarity", "barrier", or "twomethods" (for combined complementarity/barrier).

includetraitvar

Include trait variation in the simulation or not. Defaults to FALSE.

value

Value at which to determine if species interact or not - this value depends on the model you are using.

output

One of matrix or edgelist.

Value

A data.frame of network structure metrics for balanced and unbalanced trees (if output="matrix"), or an edgelist (if output="edgelist").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
trees <- rmtree(N=100, n=15)
trees2 <- rmtree(N=100, n=30)
library(doMC)
registerDoMC(4)
traitvecs <- llply(trees, fastBM, bounds=c(0,Inf), .parallel=TRUE)
traitvecs2 <- llply(trees2, fastBM, bounds=c(0,Inf), .parallel=TRUE)
alltraits <- list(traitvecs, traitvecs2)
sim_traits_nets_par(listoftraitvecs=alltraits, method="c", value=0.5, type="bal", traitm="bm", matdir="~/testtest", includetraitvar = TRUE)
sim_traits_nets_par(listoftraitvecs=alltraits, method="b", type="bal", traitm="bm", matdir="~/newfiles2")
length(out)

## End(Not run)

sckott/treeshape documentation built on May 26, 2017, 3:50 a.m.