Description Usage Arguments Value Examples
View source: R/sim_traits_nets_par.r
Simulate networks, with interactions propoprtional to trait matching
1 2 3 4 5 |
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. |
A data.frame of network structure metrics for balanced and unbalanced trees (if output="matrix"), or an edgelist (if output="edgelist").
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.