Overlapping edges
The two fundamental building blocks of a social network are nodes and edges. The weights are usually positive values.
The dataset edges contains the edges for a small network. Multiple edges between two nodes in the network could indicate a stronger link between the nodes compared to only one edge between the nodes. Instead of showing each edge individually, you can make the edges overlap where the width is equal to the number of edges.
The igraph library is loaded in your workspace, as well as the dataset edges.
Este ejercicio forma parte del curso
Fraud Detection in R
Instrucciones del ejercicio
- Create an undirected graph called
netbased on datasetedgeswithgraph_from_data_frame()and setdirectedto the appropriate boolean (TRUEorFALSE). - Plot network
netwithplot()and setlayoutto belayout_in_circle(no quotation marks""!). - To get overlapping edges, set
E(net)$widthto the number of multiple edges usingcount.multiple()onnet. Avoid having curved edges by settingE(net)$curvedto the appropriate boolean (TRUEorFALSE). - Plot
netin a circle layout again.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Create a network from the data frame
net <- ___(___, directed = ___)
# Plot the network with the multiple edges
___(___, layout = ___)
# Specify new edge attributes width and curved
E(net)$___ <- ___
E(net)$___ <- ___
# Check the new edge attributes and plot the network with overlapping edges
edge_attr(net)
___(___, layout = ___)