专栏名称: EasyCharts
EasyCharts,易图表,我们将定期推送各种数据可视化与分析教程,包括Excel(Power BI)、Origin、Sigmaplot、GraphPad、R、Python、Matlab、Tableau、D3.js等。
今天看啥  ›  专栏  ›  EasyCharts

gganimate|创建可视化动图,让你的表会说话

EasyCharts  · 公众号  · 前端  · 2019-12-09 23:18
介绍一个主要用于绘制动画的ggplot2的扩展包---gganimate包。 Hans Rosling的关于“New Insights on Poverty”的TED演讲绝对是对我影响最大的几个TED之一,原来数据可以这样展示,,,可视化可以这样炫,,,故事可以这样讲... 下面尝试使用 gganimate 包和 gapminder 数据集,实现类似可视化过程。加载R包,数据#R包安装install.packages("devtools")library(devtools)    install_github("thomasp85/gganimate")install.packages("gapminder")#加载library(gganimate)library(gapminder)#查看数据head(gapminder)# A tibble: 6 x 6  country     continent  year lifeExp      pop gdpPercap  fct>       fct>     int>   dbl>    int>     dbl>1 Afghanistan Asia       1952    28.8  8425333      779.2 Afghanistan Asia       1957    30.3  9240934      821.3 Afghanistan Asia       1962    32.0 ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照