我从CRAN安装了gganimate
个软件包,并运行提供的示例代码:
library(ggplot2)
library(gganimate)
library(gapminder)
ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, colour = country)) +
geom_point(alpha = 0.7, show.legend = FALSE) +
scale_colour_manual(values = country_colors) +
scale_size(range = c(2, 12)) +
scale_x_log10() +
facet_wrap(~continent) +
# Here comes the gganimate specific bits
labs(title = 'Year: {frame_time}', x = 'GDP per capita', y = 'life expectancy') +
transition_time(year) +
ease_aes('linear')
但是出现以下错误:
UseMethod(“ conditionCall”)中的错误:无适用的方法 “ conditionCall”应用于“ NULL”类的对象
我已经安装了magick,所以可以弄清楚我们在这里发生了什么。 任何建议将不胜感激。