plot_netassoc_network: Plots species association network

Description Usage Arguments Examples

View source: R/plot.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plot_netassoc_network(network, layout = layout.fruchterman.reingold(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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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))

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: infotheo
Calculating observed co-occurrence scores...
Generating null replicate 1...
Generating null replicate 2...
Generating null replicate 3...
Generating null replicate 4...
Generating null replicate 5...
Generating null replicate 6...
Generating null replicate 7...
Generating null replicate 8...
Generating null replicate 9...
Generating null replicate 10...
Generating null replicate 11...
Generating null replicate 12...
Generating null replicate 13...
Generating null replicate 14...
Generating null replicate 15...
Generating null replicate 16...
Generating null replicate 17...
Generating null replicate 18...
Generating null replicate 19...
Generating null replicate 20...
Generating null replicate 21...
Generating null replicate 22...
Generating null replicate 23...
Generating null replicate 24...
Generating null replicate 25...
Generating null replicate 26...
Generating null replicate 27...
Generating null replicate 28...
Generating null replicate 29...
Generating null replicate 30...
Generating null replicate 31...
Generating null replicate 32...
Generating null replicate 33...
Generating null replicate 34...
Generating null replicate 35...
Generating null replicate 36...
Generating null replicate 37...
Generating null replicate 38...
Generating null replicate 39...
Generating null replicate 40...
Generating null replicate 41...
Generating null replicate 42...
Generating null replicate 43...
Generating null replicate 44...
Generating null replicate 45...
Generating null replicate 46...
Generating null replicate 47...
Generating null replicate 48...
Generating null replicate 49...
Generating null replicate 50...
Generating null replicate 51...
Generating null replicate 52...
Generating null replicate 53...
Generating null replicate 54...
Generating null replicate 55...
Generating null replicate 56...
Generating null replicate 57...
Generating null replicate 58...
Generating null replicate 59...
Generating null replicate 60...
Generating null replicate 61...
Generating null replicate 62...
Generating null replicate 63...
Generating null replicate 64...
Generating null replicate 65...
Generating null replicate 66...
Generating null replicate 67...
Generating null replicate 68...
Generating null replicate 69...
Generating null replicate 70...
Generating null replicate 71...
Generating null replicate 72...
Generating null replicate 73...
Generating null replicate 74...
Generating null replicate 75...
Generating null replicate 76...
Generating null replicate 77...
Generating null replicate 78...
Generating null replicate 79...
Generating null replicate 80...
Generating null replicate 81...
Generating null replicate 82...
Generating null replicate 83...
Generating null replicate 84...
Generating null replicate 85...
Generating null replicate 86...
Generating null replicate 87...
Generating null replicate 88...
Generating null replicate 89...
Generating null replicate 90...
Generating null replicate 91...
Generating null replicate 92...
Generating null replicate 93...
Generating null replicate 94...
Generating null replicate 95...
Generating null replicate 96...
Generating null replicate 97...
Generating null replicate 98...
Generating null replicate 99...
Generating null replicate 100...
Calculating standardized effect sizes...
Adjusting p-values for multiple comparisons... Building network...

netassoc documentation built on May 2, 2019, 6:49 a.m.