plot_knnn_network: Plot K-Nearest Neighbour Network

View source: R/plot_knnn_network.R

plot_knnn_networkR Documentation

Plot K-Nearest Neighbour Network

Description

This function uses three.js javascript library (https://threejs.org/) (R package -> threejs: https://bwlewis.github.io/rthreejs) to draw the k-nnn. You can select the layout algorithm to arrange the network. Moreover, the network can visualize any kind of clustering (internal or external) an color the nodes by cluster. Finally the funtion return a list with the network, the layout and the colors (to use with other functions)

Usage

plot_knnn_network(net, layout = "fr", dim = 3, cluster, ...)

Arguments

net

An igraph object (preferably knnn result)

layout

String with the layout option c("fr","kk","DrL","mds")

  • fr : Fruchterman-Reingold layout. Place vertices on the plane using the force-directed layout algorithm by Fruchterman and Reingold. (default)

  • kk: The Kamada-Kawai layout algorithm. Place the vertices on the plane, or in the 3d space, based on a phyisical model of springs.

  • DrL: The DrL graph layout generator. DrL is a force-directed graph layout toolbox focused on real-world large-scale graphs, developed by Shawn Martin and colleagues at Sandia National Laboratories.

  • mds: Graph layout by multidimensional scaling. Multidimensional scaling of some distance matrix defined on the vertices of a graph.

dim

Number of network dimensions (2 or 3). Default = 3.

cluster

Two column data.frame with the nodes (column 1) and the cluster or classification(column 2)

...

Passed to layout_with_

Value

A list with the elements "graph", "layout" and "colors"

See Also

igraph


irycisBioinfo/PATO documentation built on Oct. 19, 2023, 3:07 p.m.