network_plot: Plot graph

Description Usage Arguments Value Examples

Description

Custom graph plot using igraph's layout functions.

Usage

1
2
3
4
5
network_plot(adj, names = NULL,
  layout = igraph::layout.fruchterman.reingold, nod_col = "#E0EED4",
  nod_cex = 3, nod_shadow = T, edg_col = "grey25", edg_lwd = 1.5,
  lab_col = "black", lab_cex = 1, lab_lwd = 1, lab_lcol = "grey25",
  lab_grid_size = 48, lab_padding = c(3, 3))

Arguments

adj

numeric matrix representing the adjacency matrix. Can also be an object of class "igraph" or an edge list, i.e., a two-column matrix or data.frame containing specifying the edges start and end points.

names

optional character vector specifying the node names. Must be of appropriate length.

layout

layout function from the igraph package. Default is layout.fruchterman.reingold.

nod_col

character vector of length 1 or length |V| specifying the node colors.

nod_cex

numeric speciying the size of the node circles.

nod_shadow

logical specifiying whether nodes should have shadows. Node shodow color is created from darkening node_col.

edg_col

character vector of length 1 of length |E| specifying the edge line colors.

edg_lwd

numeric vector of length 1 of length |E| specifying the edge line widths.

lab_col

character vector of length 1 of length |V| specifying the text label colors.

lab_cex

numeric vector of length 1 of length |V| specifying the text label sizes.

lab_lwd

numeric vector of length 1 of length |V| specifying the width of the lines connecting the text label to the nodes.

lab_lcol

character vector of length 1 of length |E| specifying specifying the color of the lines connecting the text label to the nodes.

lab_grid_size

integer specifying the grid size used to place the node labels. Canvas is split in lab_grid_size and labels are placed into cells closest to the associated node.

lab_padding

numeric vector of length 2 specifying the spacing among labels and between labels and nodes on the x and y dimension.

Value

nothing. A plot is created in dev.cur.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# get fluency data
data(animal_fluency)

# edge list of fluency graph
edge_list = threshold_graph(animal_fluency[1:20])

# get adjacency matrix
adj = edg_to_adj(edge_list)

# plot
network_plot(adj)

## End(Not run)

memnet documentation built on May 2, 2019, 9:35 a.m.