R ggmap: Why can I create rectangular maps using the filename attribute but not use them in the plot?

I would like to create a world map in R. I am a little familiar with ggmap , so I tried something like this:

 ggmap(get_googlemap(center=c(83,25), zoom=1, scale=4, filename="world", size=c(640,300))) 

It works fine when it comes to world.png .

The world.png output

I was very happy to find a workaround for ggmap "cannot show anything above 80 ° latitude", because of which it is more or less impossible to create maps of the whole world.

However, in R itself, that is, on the graphs, the map does not look as intended: Failed R map plot

This only happens when the map is rectangular (if the size attribute is set), and not a square (as by default).

Why? Is there a chance that this problem will be solved in the future? And what is the fastest way from here to the correct world map?

+6
source share

Source: https://habr.com/ru/post/956205/


All Articles