Network of cities with distances as edges length

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Network of cities with distances as edges length

edoardo baldoni

I am building a network using a distance matrix with the package 'network'

I want to create a network with cities as vertices and with the length of
the edges between them that reflects their distances.

How can I ? All I tried did not work

I tried the following code but the result is a graph with curved edges that
do not reflect distances between cities. It is not what I want.

nDist2 = network(Dist2,directed=TRUE)

My data matrix (Dist2) is:

Oxford Hamburg Dublin Hoersholm Oslo  Oxford 0 786.4 382.97 1013.98 1176.23
Hamburg 786.4 0 1077.74 305.9 710.03  Dublin 382.97 1077.74 0 1240.48
1268.59  Hoersholm 1013.98 305.9 1240.48 0 460.72  Oslo 1176.23 710.03
1268.59 460.72 0



        [[alternative HTML version deleted]]

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.