Learn R Programming

ggtangle (version 0.0.6)

drag_network: Drag the nodes of a network to update the layout of the network

Description

Drag the nodes of a network to update the layout of the network

Usage

drag_network(p, g = NULL)

Value

an updated ggplot/gg/ggraph object

Arguments

p

the network diagram as a ggplot/gg/ggraph object.

g

an corresponding igraph object. Default is to extract from the 'ggraph' attribute.

Examples

Run this code
if (FALSE) {
library(igraph)
library(ggraph)

flow_info <- data.frame(from = c(1,2,3,3,4,5,6),
                        to = c(5,5,5,6,7,6,7))
g = graph_from_data_frame(flow_info)
p <- ggraph(g, layout='nicely') + geom_node_point() + geom_edge_link() 
pp <- drag_network(p)
}

Run the code above in your browser using DataLab