plot_extant_matrix | R Documentation |
Plot a network with modules as an adjacency matrix
plot_extant_matrix(
net,
modules = NULL,
module_order = NULL,
find_modules = TRUE,
parasite_order = NULL,
host_order = NULL,
state_alpha = c(0.5, 1)
)
net |
An adjacency matrix for a bipartite network. Parasites should be the rows, hosts should be columns. If all values are 0/1 (or 0/2), a binary network is represented; if all values are 0/1/2, a network with potential and actual interactions is represented; otherwise a weighted network is assumed. |
modules |
A |
module_order |
A character vector giving the order that modules should be plotted. Should contain each module only once. |
find_modules |
Logical. Search for modules if nothing is provided in |
parasite_order |
A character vector giving the order the parasite should
be listed in. Should contain each parasite only once, and include the row
names of |
host_order |
A character vector giving the order the hosts should be
listed in. Should contain each host only once, and include the column names
of |
state_alpha |
A numeric vector of length 2. Gives the alpha (transparency) values for the interaction type in the three-state model |
A ggplot
object.
## Not run:
# The slow portion of this function is the calculation of the modules.
plot_extant_matrix(extant_net)
# Change our network to a weighted one:
extant_net_weighted <- extant_net
extant_net_weighted[extant_net == 1] <- runif(sum(extant_net))
plot_extant_matrix(extant_net_weighted)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.