plotGraph: plot a network graph

Description Usage Arguments Details

View source: R/functions_graph.R

Description

provide an easy way to plot a network graph returned by makeGraph function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plotGraph(
  g,
  state_label = FALSE,
  state_status = TRUE,
  state_color = c("blue", "skyblue", "gray", "red"),
  move_label = TRUE,
  method = "igraph",
  community = NULL,
  weight_in_community = 5,
  fr_iter = 1000,
  ...
)

Arguments

g

an object generated by makeGraph function.

state_label

Labels of states. It can be one of follows:

  • a vector, of which length is the number of vertexs in g, giving labels.

  • TRUE, which specifies V(g)$name as labels.

  • FALSE, which means no label.

state_status

Status of states. It can be one of follows:

  • an integer vector, of which length is the number of vertex in g, giving status.

  • TRUE, which specifies V(g)$status as status.

  • FALSE, which means no status.

state_color

a vector of color names. The ith state is colored by state_color[state_status[i]].

move_label

Labels of moves. It can be one of follows:

  • a vectorm of which length is the number of edges in g, giving labels.

  • TRUE, which specifies E(g)$name as labels.

  • FALSE, which means no label.

method

one of follows:

  • igraph': use igraph::plot

  • 'GGally': use GGally::ggnet2

community

an object of 'igraph::communities' class, giving community of g. If specified, weights are assigned to edges so that communities are separated each other. It can be specified only when method = 'igraph'.

weight_in_community

weights for edges within same community. Bigger value makes communities to be separated much more. Only effective when community is specified.

fr_iter

iteration for fruchterman reingold algorithm. Only effective when community is specified.

...

pass to igraph::plot or GGally::ggnet2

Details

To plot with more detailed specification, use igraph::tkplot or GGally::ggnet2 function instead. For huge graphs consider to use other software like Gephi.

see makeGraph for example code.


shigono/rSlidePzl documentation built on Jan. 21, 2021, 8:01 a.m.