if (FALSE) {
data(Safariland)
# confint:
N100 <- sapply(swap.web(100, Safariland), networklevel, index="nestedness")
quantile(unlist(N100), c(0.025, 0.975))
# intasymm: extract values for the asymmetry of interactions and the
# dependency matrix for pollinators:
specieslevel(Safariland)$"higher trophic level"$"interaction push/pull"
specieslevel(Safariland)$"higher trophic level"$"dependence"
# for plants:
specieslevel(Safariland)$"lower trophic level"$"interaction push/pull"
specieslevel(Safariland)$"lower trophic level"$"dependence"
#intereven
networklevel(Safariland, index="interaction evenness", intereven="sum")[2]
# or, as we recommend (see help on networklevel):
networklevel(Safariland, index="interaction evenness", intereven="prod")[2]
# mlik:
# calculates the log-likelihood of observing a network, given a probability
# matrix of the same size (pweb):
dmultinom(Safariland>0, prob=pweb, log=TRUE)
# AIC (the number of parameters is given by how many constraints are put onto the
# null model; here, we constrain 9 rows and 27 columns, i.e. sum(dim(binweb))):
-2*dmultinom(Safariland>0, prob=pweb, log=TRUE) + 2*(sum(dim(binweb)))
# netstats:
networklevel(Safariland,
index=c("connectance", "interaction evenness", "nestedness", "ISA"))
mean(specieslevel(Safariland)$"higher trophic level"$"interaction push/pull")
mean(specieslevel(Safariland)$"lower trophic level"$"interaction push/pull")
#plotmat:
visweb(t(unname(Safariland)), circles=TRUE, boxes=FALSE)
#sortmatr/sortmatrext:
sortweb(Safariland, sort.order="inc") #rares species first
plotweb(sortweb(Safariland, sort.order="dec"), method="normal")
plotweb(sortweb(web=Safariland, sort.order="seq",
sequence=list(seq.higher=sample(colnames(Safariland)),
seq.lower=sample(rownames(Safariland)))),
method="normal")
}
Run the code above in your browser using DataLab