I am working on a similar problem. I have to add two columns: one containing
the US state to which the origin belongs and another one to add the state in
to which destination belongs. All I have is the latitude and the longitude
of the origin and destination. Are there any packages in R that can do
made my day, thanks, worked just fine with a little bit of tweaking
(flipping x and y around, basically).
rapid response much appreciated
Dick
On Wed, Jul 2, 2008 at 5:25 PM, Ray Brownrigg
<[EMAIL PROTECTED]> wrote:
> Here's one solution, YMMV:
> library(maps)
> # Note, plot the map first to get
Here's one solution, YMMV:
library(maps)
# Note, plot the map first to get the aspect ratio (or projection) right
map("county", xlim=range(df2VisitTrips[, c(5, 7)]), ylim=range(df2VisitTrips[,
c(4, 6)]),
col=8)
map("state", add=T)
map.axes()
for (i in 1:length(df2VisitTrips[, 1])) {
lines(df2Vi
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
4 matches
Mail list logo