[R] flow map lines between point pairs (latitude/longitude)

Richard and Barbara Males rbmales at gmail.com
Wed Jul 2 20:55:42 CEST 2008


I have a dataset giving traffic between pairs of ports, and the
lat/lon of each port, roughly as follows:

sample data as follows

> df2VisitTrips[1:4,]
  Origin Destination NumberOfTrips OriginLatitude OriginLongitude
DestinationLatitude DestinationLongitude
1     P1         P16             1               39.45965
-80.15633        40.76111            -79.54583
2     P1          P3              1               39.45965
-80.15633        39.58861            -79.98222
3   P102        P108          19              36.98210       -88.21597
       37.19667            -88.84389
4   P102        P109           71              36.98210
-88.21597       37.09472            -89.13694


I am interested in plotting variable-width lines, based on
NumberOfTrips, between point pairs (OriginLongitude,OriginLatitude)
and (DestinationLongitude,DestinationLatititude), e.g. a flow map
between the ports.  At some point, I may wish to add an underlay base
map (say counties in the US), but that is not critical at this time.

There seem to be many packages in R that deal with spatial data (sp,
maps, PBSMapping, etc.), but it is unclear to me which one would work
best for this application.

Any advice gratefully appreciated.

R. Males
Cincinnati, Ohio, USA



More information about the R-help mailing list