MaxLinks: Maximum number of links for every interaction type

Description Usage Arguments Value Examples

View source: R/MaxLinks.R

Description

Returns the maximum number of links that can be realized in a given community per interaction type, i.e. if an interaction type was allowed to fill the entire link space

Usage

1
MaxLinks(tl.results, potential.links)

Arguments

tl.results

a dataframe as given by AssignTrophicLevel

potential.links

a dataframe as given by PotentialLinks(...,return.type = "positions")

Value

numeric vector of length 5

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
tl.results <- AssignTrophicLevel(num.sp = 20,
                                 trophic.levels = 4,
                                 abundance.distribution = "gambin",
                                 scaling.law.tl = TRUE,
                                 scaling.exponent.tl = 0.75,
                                 basal.abundance = 1000,
                                 gambin.alpha = 2,
                                 gambin.maxoctave = 8)

within.type.prob <- data.frame(interaction.type = c(rep("competition",3),rep("amensalism",3),rep("antagonism",3),rep("mutualism",3),rep("commensalism",3)),
                   tl.category = rep(c("same","adjacent","other"),5),
                   prob = rep(0.33,15))
within.type.prob$prob[within.type.prob$interaction.type == "antagonism" & within.type.prob$tl.category == "same"] <- 0
within.type.prob$prob[within.type.prob$interaction.type == "antagonism" & within.type.prob$tl.category == "adjacent"] <- 0.75
within.type.prob$prob[within.type.prob$interaction.type == "antagonism" & within.type.prob$tl.category == "other"] <- 0.25
potential.links <- PotentialLinks(tl.results,within.type.prob)
max.links <- MaxLinks(tl.results,potential.links)

DavidGarciaCallejas/DGC documentation built on May 6, 2019, 1:54 p.m.