FIGURE 2. Distances between three selected locations from the fdata sample data. Distances given between points are in km.

>data(fdata.lats)
>fd.subset<-coordinates(fdata.lats)[1:3,]
>earth.dist(fdata.lats[1:3,])

locA locB
locB 893.4992
locC 776.3101 867.2648

>map("state")
>polygon(fd.subset)
>text(c(-110,-101,-106),c(42,42,47),labels=round(earth.dist(fd.subset)[c(1,
+3,2)]))
>points(fd.subset,pch=16,col="white",cex=3)
>points(fd.subset,pch=1,cex=3)
>text(fd.subset,label=LETTERS[1:3])