I have a square matrix in which each elements contains the amount of connexions between the points associated with the corresponding row and column. I also have a list of coordinates for each of those points. My purpose is to plot this matrix such that the points are represented according to their coordinates and that the number of connections beween them are represented by lines of different thickness. I've tried using the igraph package to do this but I can't find a way to associate geographical coordinates to my rows and columns.
My current code is the following:
library(igraph)
connectivityMatrix <- as.matrix(read.table(file='settlementMatrix004800.dat'))
g <- graph.adjacency( connectivityMatrix, weighted=TRUE, mode="undirected" )
plot(g)
This plots the points and the connections but the topology of the network is not taken into account. I also tried with the statnet package and couldn't either find a way to take into account the coordinates.
library(statnet)
connectivityMatrix <- as.matrix(read.table(file='settlementMatrix004800.dat'))
net <- as.network(connectivityMatrix, matrix.type = "adjacency", directed = TRUE)
bet <- betweenness(net)
gplot(net, mode="segeo")
Do you have a good advice to do this?
Thanking you in advance,