dkahle / dkahle/ggmap

Weird results from mapdist()

Open
#308 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
778
Forks
234
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am recently using mapdist() to calculate the distances between some cities in Taiwan:

``` r
library(ggmap)
from <- c("Taipei", "Taipei", "Taipei")
to <- c("Taichung", "Tainan", "Kaohsiung")
mapdist(from, to)
```

The results make sense to me:
Taipei > Taichung 165 km
Taipei > Tainan 310 km
Taipei > Kaohsiung 355 km

However, when I did the reverse, I got the following results:

``` r
from <- c("Taichung", "Tainan", "Kaohsiung")
to <- c("Taipei", "Taipei", "Taipei")
mapdist(from, to)
```

Taichung > Taipei 311 km
Tainan > Taipei 164 km
Kaohsiung > Taipei 356 km

The distances themselves are still correct, but they didn't line up with the city pairs. I wonder why this could happen. Is there any way to solve the problem? Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.