相关疑难解决方法(0)

动画排序的条形图与酒吧互相超越

你如何从R的Jaime Albella再现这张图表?

visualcapitalist.comtwitter上查看动画(如果有一个中断,请提供几个参考).

在此输入图像描述

我将其标记为ggplot2,gganimate但是可以从R生成的任何内容都是相关的.

数据(感谢https://github.com/datasets/gdp)

gdp <- read.csv("https://raw.github.com/datasets/gdp/master/data/gdp.csv")
# remove irrelevant aggregated values
words <- scan(
  text="world income only total dividend asia euro america africa oecd",
  what= character())
pattern <- paste0("(",words,")",collapse="|")
gdp  <- subset(gdp, !grepl(pattern, Country.Name , ignore.case = TRUE))
Run Code Online (Sandbox Code Playgroud)

animation r data-visualization ggplot2 gganimate

18
推荐指数
3
解决办法
6344
查看次数

错误:动画对象未指定 save_animation 方法

我试图按照下面的方法用 R 创建一个条形图竞赛。当我尝试将它们另存为 gif 文件时,所有 png 都会被创建,然后我得到:

Error: The animation object does not specify a save_animation method
Run Code Online (Sandbox Code Playgroud)

是否因为我创建了多个文件而发生这种情况?

#This script contains a function to produce a "bar chart race" in R

#The following links were invaluable:
#https://www.blakeshaffer.ca/post/making-animated-charts-with-gganimate/
#/sf/ask/3683660571/


#load required packages:
library(tidyverse)
library(gganimate)


#inputs:
#data - the dataset, must contain a column called "year"
#x - the column which contains the numeric value to plot 
#y - the column which contains the labels of the plot

#optional: 
#title - title …
Run Code Online (Sandbox Code Playgroud)

r ggplot2 gganimate

9
推荐指数
2
解决办法
7627
查看次数

标签 统计

gganimate ×2

ggplot2 ×2

r ×2

animation ×1

data-visualization ×1