如果我在 Shiny 应用程序中绘制一个 gganimate 对象,它会占据整个屏幕!完全删除我所有漂亮的输入栏。我想知道,我如何保留我的输入?
看看这个简单的例子。
在此先感谢您的帮助 !
担
library ( shiny )
library ( gganimate)
library ( ggplot2)
ui = fluidPage(
textInput("a","put letters here",value = "dave" ),
plotOutput("b")
)
server = function(input, output){
output$b= renderPlot ( {
p = ggplot(iris, aes(x = Petal.Width, y = Petal.Length)) +
geom_point()+
transition_states(Species)+
ggtitle ( input$a)
animate ( p,nframes = 40)
} )
}
shinyApp ( ui , server)