powered by
This function plots the graph of the data frame and optionally uses different colors for nodes belonging to different connected components.
networkPlot( df, title = NULL, numCol = NULL, numColType = c("weights", "ranks"), nodeSize = 10, nodeTextSize = 2.3, palette = "grDevices::Spectral", nodeColor = NULL, edgeWidth = 1, edgeColor = "black", edgeScales = c(0.2, 0.6), ... )
An object of class ggraph.
ggraph
Data frame.
Plot title.
Name of the numeric column used to vary edge widths. If no such column is provided, set to NULL.
NULL
The type of the numeric column used to vary edge widths. Choose between 'weights' and 'ranks' Ignored if numCol is NULL.
numCol
Size of graph nodes.
Size of text on graph nodes.
grDevices palette used for coloring nodes. Ignored if nodeColor is not NULL.
Color used for nodes. Default is NULL (palette will instead be used).
palette
Width to be used for all edges before scaling if numCol is NULL; otherwise ignored.
Color used for edges.
Edge width scales. Must be a numeric vector of size 2 (minimum and maximum).
Additional arguments passed to centerTitle.
centerTitle
df <- data.frame(gene1 = paste0('G', c(1, 2, 5, 6, 7, 17)), gene2 = paste0('G', c(2, 5, 8, 11, 11, 11)), rank = c(1, 1, 3, 3, 3, 3)) networkPlot(df, numCol='rank', numColType='ranks')
Run the code above in your browser using DataLab