小编Ung*_*rer的帖子

还有其他方法可以实现R的累积动画吗?

accumulate_by <- function(dat, var) {
  var <- lazyeval::f_eval(var, dat)
  lvls <- plotly:::getLevels(var)
  dats <- lapply(seq_along(lvls), function(x) {
    cbind(dat[var %in% lvls[seq(1, x)], ], frame = lvls[[x]])
  })
  dplyr::bind_rows(dats)
}

d <- txhousing %>%
  filter(year > 2005, city %in% c("Abilene", "Bay Area")) %>%
  accumulate_by(~date)
Run Code Online (Sandbox Code Playgroud)

如果以上述功能的方式实现累积动画,则行数将增加太多。

我用一千帧,一万行。由于大量数据,正在进行的工作受到了干扰。

https://plot.ly/r/cumulative-animations/

除示例外,还有什么方法可以创建累积动画?帮我!

animation r plotly r-plotly

6
推荐指数
1
解决办法
356
查看次数

标签 统计

animation ×1

plotly ×1

r ×1

r-plotly ×1