Learn R Programming

netassoc (version 0.7.0)

plot_netassoc_network: Plots species association network

Description

Draws a network of species associations. By default edge widths are proportional to association strength and edge color reflects association type (blue, positive; red, negative).

Usage

plot_netassoc_network(network, layout = layout_nicely(network), 
  vertex.label = V(network)$name, 
  vertex.color = NA, 
  vertex.shape = "none",
  vertex.label.color = "black", 
  vertex.label.family = "sans",
  edge.width = NULL, 
  edge.color = NULL, 
  edge.arrow.size = 0.2, 
  vertex.label.cex = 0.5, 
  legend = TRUE,
   ...)

Arguments

network

An igraph object corresponding to the association network

layout

Graphical layout. See igraph::layout.

vertex.label

String labels for species.

edge.width

Edge widths for links between species.

edge.color

Edge colors for links between species.

vertex.color

Vertex colors for species.

vertex.label.color

Vertex label colors for species.

vertex.shape

Vertex shape for species.

edge.arrow.size

Edge arrow size for links between species.

vertex.label.cex

Vertex label expansion factor for species.

vertex.label.family

Vertex shape font family for species.

legend

If TRUE, plots a scale legend.

...

Other arguments to be passed to plot.igraph.

Examples

Run this code
# generate random data
set.seed(5)
nsp <- 10
nsi <- 5
m_obs <- floor(matrix(rgamma(nsp*nsi,shape=5),ncol=nsi,nrow=nsp))
m_nul <- floor(matrix(rexp(nsp*nsi,rate=0.05),ncol=nsi,nrow=nsp))

n <- make_netassoc_network(m_obs, m_nul, numnulls=100, plot=TRUE,alpha=0.5)

# plot
plot_netassoc_network(n$network_all)

# plot using circular layout
plot_netassoc_network(n$network_all, layout=layout.circle(n$network_all))

Run the code above in your browser using DataLab