How to incresase igraph distance for each edge in R?

I have a CSV file need to draw a graph.

CSV file data

The graph contains nodes and edges.

Therefore, I used the following code to do it.

start.time <- Sys.time()

#Loading Packages
library(igraph)
library(readr)
library(haven)

#import data
df = read.csv('../../Pre_Draw_Graph_for_R.csv', header = TRUE, encoding = 'UTF-8')

#Creating an iGraph Style Edge List
df_Edge_List <- df

#Creating Graph
df_graph = graph.data.frame(df_Edge_List, directed = TRUE)

#df Network: First Try
#Layout Options
set.seed(3500)
layout1 <- layout.fruchterman.reingold(df_graph)

#Node or vertex Options: Color
V(df_graph)$color <- "yellow"
V(df_graph)[degree(df_graph, mode = "in") > 500]$color <- "red"

#Edge Options: Size
E(df_graph)$color <- "grey"

#Plotting
plot(df_graph, vertex.label=NA)
#plot(df_graph)


end.time <- Sys.time()
time.taken <- end.time - start.time
time.taken

I can output the following result, but the result has some problems. It shows that every node is very crowded.

My Graph

enter image description here

I hope to increase the graph distance, but I used a lot of methods already. I cannot fix the problem. I hope to get the following result, but I cannot do it now. I want to make it clear to see the graph.

enter image description here

Can anyone help me? Thanks

Hi, welcome!

We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.