我只是尝试使用以下在线代码在我的学习区域绘制一张地图,但即使使用了在线代码,它也会产生以下错误:
**install.packages(c("cowplot","googleway", "ggplot2", "ggrepel",
"ggspatial", "libwgeom", "sf", "rnaturalearth", "rnaturalearthdata"))
library("ggplot2")
theme_set(theme_bw())
library("sf")
library("rnaturalearth")
library("rnaturalearthdata")
world <- ne_countries(scale = "medium", returnclass = "sf")
class(world)**St_as_sfc.SpatialPolygons中的错误(sp::几何学(X),.):找出哪个孔属于哪个外部环所需的软件包rgeos
类(World)错误:找不到对象“world”
我不知道是什么导致了这个错误,因为我在R中是新的,任何建议都将不胜感激。
发布于 2020-12-13 06:37:11
您只需安装rgeos软件包并加载它即可。
install.packages(c("cowplot","googleway", "ggplot2", "ggrepel",
"ggspatial", "libwgeom", "sf", "rnaturalearth", "rnaturalearthdata",
"rgeos"))
library("ggplot2")
theme_set(theme_bw())
library("sf")
library("rnaturalearth")
library("rnaturalearthdata")
library(rgeos)
world <- ne_countries(scale = "medium", returnclass = "sf")
class(world)**
https://stackoverflow.com/questions/65272841
复制相似问题