I have an n.n matrix, like the following picture and I want to create a graph that shows me the relationship between them.
In this case that is a real case, I have 4 column that contains traffic flow of a computer network, and the elements ere [Source IPs, Source Ports, Destination IPs, Destination Ports],
As I did a little bit of search about this issue, I can use R studio and "ggplot" function.
I have two questions and I would appreciate you in advance if you can help me to do this job or at least give me more hint or clue to do it.
The first question is how to create a graph from a matrix?
The second question is how can I do I practically like using software like RStudio?

Check out the Graphviz graph layout and visualization package
Using your example data, the directed graph can be described as
ip.dotfile:and the
dot -Tps ip.dotcommand generates a graph