getOverlap goes through all m-wise combinations of species and returns the amount of overlap between species in functions they perform for each combination

getOverlap(
  overData,
  m = 2,
  type = "positive",
  index = "sorensen",
  denom = "set"
)

Arguments

overData

Matrix of functions and which species affect them from getRedundancy.

m

Number of functions. Defaults to 2.

type

Are the kinds of effects we're looking at "positive", "negative" or "all".

index

Type of overlap index to be used. Defaults to "sorenson" but currently incorporates "mountford" and "jaccard" as well.

denom

Should the denominator be "all" species or just the "set" of species with the types of interactions being considered? Defaults to "set".

Value

Returns a vector of overlap indices.

Details

getOverlap takes a matrix of 1s and -1s, and depending on whether we're interested in positive, negative, or both types of interactions looks for the m-wise overlap between species and returns the overlap index for each combination

Author

Jarrett Byrnes.

Examples

data(all_biodepth)
allVars <- qw(biomassY3, root3, N.g.m2, light3, N.Soil, wood3, cotton3)

germany <- subset(all_biodepth, all_biodepth$location == "Germany")

vars <- whichVars(germany, allVars)
species <- relevantSp(germany, 26:ncol(germany))

# re-normalize N.Soil so that everything is on the
# same sign-scale (e.g. the maximum level of a function is the "best" function)
germany$N.Soil <- -1 * germany$N.Soil + max(germany$N.Soil, na.rm = TRUE)

res.list <- lapply(vars, function(x) sAICfun(x, species, germany))
names(res.list) <- vars

redund <- getRedundancy(vars, species, germany)

getOverlap(redund, m = 2)
#>  [1] 0.1818182 0.6666667 0.4615385 0.3333333 0.3636364 0.3333333 0.0000000
#>  [8] 0.1538462 0.3333333 0.0000000
getOverlap(redund, m = 2, index = "jaccard")
#>  [1] 0.10000000 0.50000000 0.30000000 0.20000000 0.22222222 0.20000000
#>  [7] 0.00000000 0.08333333 0.20000000 0.00000000
getOverlap(redund, m = 2, index = "mountford")
#>  [1] 0.04081633 0.33333333 0.13333333 0.08333333 0.10526316 0.08695652
#>  [7] 0.00000000 0.02816901 0.08333333 0.00000000

#########
# getOverlap takes a matrix of 1s and -1s, and depending on whether we're
# interested in positive, negative, or both types of interactions looks for the
# m-wise overlap
#########