【发布时间】:2016-05-27 02:30:15
【问题描述】:
我可以将保存的文件加载为图像,但无法使用gganimate 直接执行此操作。很高兴知道渲染 GIF 的其他方法,但知道如何渲染 gganimate 会真正解决我的问题。
library(gapminder)
library(ggplot2)
library(shiny)
library(gganimate)
theme_set(theme_bw())
ui <- basicPage(
plotOutput("plot1")
)
server <- function(input, output) {
output$plot1 <- renderPlot({
p = ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) +
geom_point() +
scale_x_log10()
gg_animate(p)
})
}
shinyApp(ui, server)
【问题讨论】: