我可以将保存的文件加载为图像,但无法直接使用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)
gifski
包。https://stackoverflow.com/questions/58336048/error-in-animate-default-animation-of-gg-objects-not-supported - Phil