【发布时间】:2021-08-11 09:42:46
【问题描述】:
我正在尝试制作以下数据的动画累积地图:
structure(list(station_install_date = structure(c(16684, 16684,
16684, 16684, 16684, 16684), class = "Date"), lat = c(37.548645,
37.549561, 37.550007, 37.550629, 37.552746, 37.554951), long = c(126.912827,
126.905754, 126.914825, 126.914986, 126.918617, 126.910835),
capa_sum = c(10L, 5L, 5L, 13L, 10L, 14L)), row.names = c(NA,
-6L), groups = structure(list(station_install_date = structure(c(16684,
16684, 16684, 16684, 16684, 16684), class = "Date"), lat = c(37.548645,
37.549561, 37.550007, 37.550629, 37.552746, 37.554951), .rows = structure(list(
1L, 2L, 3L, 4L, 5L, 6L), ptype = integer(0), class = c("vctrs_list_of",
"vctrs_vctr", "list"))), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"), .drop = TRUE), class = c("grouped_df",
"tbl_df", "tbl", "data.frame"))
我的代码如下:
seoul <- get_googlemap("Seoul, South Korea", zoom=11, maptype = "roadmap")
ggmap(seoul) +
geom_point(data = install_time_df, aes(x = long, y = lat), color = "red", alpha = 0.3) +
transition_time(station_install_date) +
ease_aes("linear")
但是,我不断收到错误消息:
Error in seq.default(range[1], range[2], length.out = nframes) :
'from' must be a finite number
【问题讨论】:
标签: r ggplot2 error-handling gganimate