Skip to contents

Visualize a network with custom layouts

Usage

ggNetView(
  graph_obj,
  layout = NULL,
  node_add = 7,
  ring_n = NULL,
  r = 1,
  center = TRUE,
  idx = NULL,
  shrink = 1,
  k_nn = 8,
  push_others_delta = 0,
  layout.module = c("random", "adjacent", "order"),
  shape = 21,
  pointalpha = 1,
  pointsize = c(1, 10),
  pointstroke = 0.3,
  group.by = "Modularity",
  fill.by = "Modularity",
  jitter = FALSE,
  jitter_sd = 0.1,
  mapping_line = FALSE,
  curve = F,
  curvature = 0.25,
  linealpha = 0.25,
  linecolor = "grey70",
  label = FALSE,
  labelsize = 10,
  labelsegmentsize = 1,
  labelsegmentalpha = 1,
  add_outer = FALSE,
  outerwidth = 1.25,
  outerlinetype = 2,
  outeralpha = 0.5,
  nodelabsize = 5,
  remove = FALSE,
  orientation = "up",
  angle = 0,
  scale = T,
  anchor_dist = 6,
  nrow = NULL,
  ncol = NULL,
  snake = FALSE,
  seed = 1115
)

Arguments

graph_obj

An graph object from build_graph_from_mat or build_graph_from_df. The network object to be visualized.

layout

Character string. Custom layouts; one of "gephi", "square", "square2", "petal", "petal2", "heart_centered","diamond", "star", "star_concentric","rectangle, "rightiso_layers" etc.

node_add

Integer (default = 7). Number of nodes to add in each layer of the layout.

ring_n

Numeric (default = 7) Numbers of ring in rings layout.

r

Numeric (default = 1). Radius increment for concentric or layered layouts.

center

Logical (default = TRUE). Whether to place a node at the center of the layout.

idx

Optional. Index of nodes to be emphasized or centered in the layout

shrink

Numeric (default = 1). Shrinkage factor applied to the center points.

k_nn

Numeric (default = 8). Number of nearest neighbors used to build the local adjacency graph.

push_others_delta

Numeric (default = 0). Radial offset applied to the "Others" module to slightly

layout.module

Character (default = "random") - adjacent : modules are positioned close to each other, minimizing inter-module gaps. - order : modules are distributed by order, applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout`

shape

Integer (default = 21). The point shape likely in ggplot2.

pointalpha

Integer (default = 1). The point alpha

pointsize

Vector (default = c(1,10)) The point size rang.

pointstroke

Integer (default = 0.3).

group.by

Character (default = "Modularity"). Change group for nodes

fill.by

Character (default = "Modularity"). Change fill for nodes

jitter

Logical (default = FALSE). Whether to apply jitter to points.

jitter_sd

Integer (default = 0.1). The standard deviation of the jitter applied when `jitter = TRUE`.

mapping_line

Logical (default = FALSE). Whether to mapping line in ggNetView.

curve

Logical (default = FALSE). Whether to plot curve line in net plot.

curvature

Integer (default = 0.25) The curve level of curve line when curve is TRUE

linealpha

Integer (default = 0.25). Change line alpha.

linecolor

Character (default = "grey70"). Change line color.

label

Logical (default = FALSE). Whether to display node labels in the center points.

labelsize

Integer (default = 10). Change Module label size.

labelsegmentsize

Integer (default = 1). Change label segment size.

labelsegmentalpha

Integer (default = 1). Change label segment alpha.

add_outer

Logical (default = FALSE). Whether to add an outer circle/border around the layout.

outerwidth

Integer (default = 1.25). Change outer linewidth.

outerlinetype

Integer (default = 2). Change outer linetype.

outeralpha

Integer (default = 0.5). Change outer alpha.

nodelabsize

Integer (default = 5). Change node label size.

remove

Logical (default = FALSE). Delect nodes that are not modules.

orientation

Character string. Custom orientation; one of "up","down","left","right".

angle

Integer (default = 0). Change orientation angle.

scale

Logical (default = T). modules applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout` to scale the radius

anchor_dist

Integer (default = 6) the distance of each modules, applicable to `Bipartite, Tripartite, Quadripartite, Multipartite, Pentapartite Layout`

nrow

Integer (default = NULL). the nrow of network with layout is "consensus_module_equal_gephi" or "consensus_module_gephi"

ncol

Integer (default = NULL). the ncol of network with layout is "consensus_module_equal_gephi" or "consensus_module_gephi"

seed

Integer (default = 1115). Random seed for reproducibility.

Value

A ggplot object representing the network visualization.

Examples

NULL
#> NULL