【发布时间】:2021-05-24 19:54:35
【问题描述】:
你会在GitHub找到这个问题的副本。
我尝试使用带有 geom_sf 和 ggplotly 的 ggplot 为地图制作动画。在以下示例中,地图不会随时间而改变。例如,动画散点图是可能的。任何帮助表示赞赏。
library(sf)
library(tidyverse)
library(plotly)
library("rnaturalearth")
library("rnaturalearthdata")
world <- ne_countries(scale = "medium", returnclass = "sf")
world$year <- 2010
world2 <- world
world2$year <- 2011
world2$pop_est <- 1000000
world3 <- bind_rows(world, world2)
plt <- ggplot(world3, aes(fill = pop_est, frame = year)) +
geom_sf()
ggplotly(plt)
【问题讨论】: