我正在从GitHub运行某人的代码,并且产生了错误:
grid.Call(C_textBounds,as.graphicsAnnot(x $ label),x $ x,x $ y, :找不到多边形边缘
有人可以帮助我了解问题出在哪里吗?
代码是这样的:
ggplot() +
# municipality polygons
geom_polygon(data = map_data,
aes(fill = avg_age_15, x = long, y = lat, group = group)) +
# municipality outline
geom_path(data = map_data,
aes(x = long, y = lat, group = group),
color = "white", size = 0.1) +
coord_equal() +
# add the previously defined basic theme
theme_map() +
labs(x = NULL, y = NULL,
title = "Switzerland's regional demographics",
subtitle = "Average age in Swiss municipalities, 2015",
caption = "Geometries: ThemaKart, BFS; Data: BFS, 2016")