R 中是否有替代函数来获取世界地图

问题描述 投票:0回答:1

我目前正在使用countrySP <- getMap(resolution='low') from rworldmap but this package has now been depreciated. Is there a new way to get a spatial polygon map from a different package. Alternatively all I really need is a way to identify the country from a set of decimal coordinates. Is there an easier way to do this?

我已经尝试过了

`countriesSP <- ne_countries(
scale = 10,
type = "countries",
continent = NULL,
country = NULL,
geounit = NULL,
sovereignty = NULL,
returnclass = c("sp", "sf")

)`

但是将来的版本中也会删除 sp 选项,我不知道如何使用 sf 版本。

r maps spatial
1个回答
0
投票

我相信

ggplot2::map_data("world")
可能会提供您正在寻找的内容,请参阅文档 here

查看该页面上的示例,看看是否正确。

© www.soinside.com 2019 - 2024. All rights reserved.