# NOT RUN {
# Toy example representing a typical bipartite format.
bp.inter <- matrix(c(1, 2, 2, 0, 5, 3, 3, 0, 2), nrow = 3, byrow = FALSE,
dimnames = list(c("A", "B", "C"),
c("sp1", "sp2", "sp3")))
bp.inter
expand_matrix(bp.inter)
# Use a simplified version of the Silene data set, pooling data
# across the 11 visits.
int.summ <- aggregate(Silene[, 3:7], by = list(Silene$Insect), sum)
colnames(int.summ)[1] <- "taxon"
expand_matrix(int.summ[, -1], r.names = int.summ$taxon, MARGIN = 2)
# }
Run the code above in your browser using DataLab