network_rjs: Produce interactive network graph

Description Usage Arguments Value Author(s) See Also Examples

View source: R/network.R

Description

network_rjs creates an interactive network graph.

Usage

1
2
3
4
5
network_rjs(links, nodes = NULL,
            weight = NULL, linkLabel = NULL, linkColor = NULL,
            group = NULL, size = NULL, color = NULL, label = NULL,
            nodeColorScale = c("RdBk","RdBkGr"), cex = 1, 
            plot = TRUE, jupyter = FALSE, dir = tempdir())

Arguments

links

an edge list table stored in a data frame with at least two columns (source node id and target node id).

nodes

a node list stored in a data frame object with rownames as node id.

weight

a vector giving the column of links to show as weight. If NULL but third links column is numeric, this one will be used as weight.

linkLabel

a vector giving the column of links to show as link text.

linkColor

a vector giving the column of links to compute link color or directly a vector of colors.

group

a vector giving the column of nodes to show as group.

size

a vector giving the column of nodes to show as size.

color

a vector giving the column of nodes to compute node color or directly a vector of colors.

label

a vector giving the column of nodes to show as label.

nodeColorScale

a "character" string representing the color scale applied to nodes by default.

cex

number indicating the amount by which plotting text and symbols should be scaled relative to the default.

plot

open resulting graph in your browser.

jupyter

embed the graph as an iframe into a Jupyter Notebook.

dir

a "character" string representing the directory where the graph will be saved.

Value

The function creates a folder in your computer with an HTML document named index.html which contains the graph. This file can be directly opened with your browser.

Author(s)

David Barrios and Carlos Prieto. Bioinformatics Service of Nucleus, University of Salamanca. See https://bioinfo.usal.es/

See Also

The ‘RJSplot’ Website: https://rjsplot.usal.es

dendrogram_rjs, densityplot_rjs, genomemap_rjs, heatmap_rjs, manhattan_rjs, network_rjs, scatterplot_rjs, symheatmap_rjs, wordcloud_rjs, boxplot_rjs, bubbles_rjs, hiveplot_rjs, piechart_rjs, barplot_rjs, tables_rjs, surface3d_rjs, scatter3d_rjs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Create an interactive network graph in a temporal directory of your local machine
## Live examples on https://rjsplot.usal.es

if(interactive()){
# Prepare data
x <- 1-cor(t(mtcars))

source <- rep(rownames(x),nrow(x))
target <- rep(rownames(x),rep(ncol(x),nrow(x)))
links <- data.frame(source=source,target=target,value=as.vector(x))

# Generate the network graph
network_rjs(links[links[,3]>0.1,], mtcars, group = "cyl", size = "hp", color = "mpg")
}

RJSplot documentation built on Dec. 11, 2021, 9:36 a.m.

Related to network_rjs in RJSplot...