This function generates a degree distribution plot for the binary interaction matrix 'Z'. Optionally, you can compare the observed matrix to the posterior matrix by including it as 'Z_est'. By default the function plots the degree for both rows (hosts) and columns (parasites), but you can modify this with the parameter 'type'.

plot_degree(
  Z,
  Z_est,
  type = "both",
  host.col = "blue",
  parasite.col = "red",
  cex.lab = 1.5,
  cex.axis = 2,
  pt.cex = 1.5,
  legend.cex = 2
)

Arguments

Z

bipartite interaction matrix

Z_est

the posterior bipartite interaction matrix (optional)

type

whether to plot 'hosts', 'parasites', or 'both'

host.col

Colour to use for hosts (default is 'blue')

parasite.col

Colour to use for parasites (default is 'red')

Examples

# Simluate a Z matrix and plot the degree distributions
# NOT RUN { Z <- matrix(rbinom(50*200, 1, 0.01), nrow=50, ncol=200) Z <- Z[,colSums(Z)>0] plot_degree(tree) # }