我如何用R中的Animation创建Shiny应用程序? [英] How can I build Shiny applications with Animation in R?

查看:219
本文介绍了我如何用R中的Animation创建Shiny应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一个闪亮的应用程序来与R构建交互动画。我目前有一个函数可以使用Animation包( http://cran.r-project.org/package=animation )通过一系列ggplots(按日期)循环。同时也是一个闪亮的应用程序,可以显示基于选定日期的单个ggplot。我想构建一个闪亮的应用程序,刷新基于选定日期范围的动画。

I am trying to build a shiny app to build interactive animations with R. I currently have a function that can build gifs/other output options using the Animation package(http://cran.r-project.org/package=animation) that loops through a series of ggplots(by date). And also a shiny app that can show a single ggplot based on the selected date.I want to build a shiny app that refreshes an animation based on a selected date range.

在Shiny中有没有使用带UI输出的saveHTML的代码示例?这可能吗?

Are there examples of code that uses maybe saveHTML with UIoutput in Shiny? Would this be possible?

在Shiny R中重置动画Studio 显示有人试图在Shiny中构建动画。 https://gist.github.com/yihui/5899181 是集成saveGIF函数的示例成一个闪亮的应用程序,但这是通过下载。

reset animation in Shiny R Studio shows someone trying to build an animation within Shiny. https://gist.github.com/yihui/5899181 is example of integrating a saveGIF function into a shiny app, but that is through a download.

另一个建议/包我可以看看在R中不一定使用动画和/或Shiny来解决这个问题。

Alternative suggestions/packages I could look at to approach this problem in R not necessarily using Animation and/or Shiny would also be appreciated.

推荐答案

我建议使用googleVis包 - >工具gvisMotionchart。处理起来非常简单,只要确保数据是以数字或时间为导向的,并且还可以将某些字符/分类变量绘制为圆形。最重要的是,所有的动画工具都已包含在动画图表中。

I suggest using the googleVis package --> the tool, gvisMotionchart. It's really simple to work with, just make sure your data is numeric or time oriented in some way and also have some character/categorical variable to plot as circles. Best of all is that all animation tools are ALREADY included inside the motion chart.

如果您想了解如何创建这些细节,请参阅以下模型示例这个线程。

If you want details how to create this, here is a model example of how to detailed in this thread.

使用googleVis在本地运行时不会生成图表

Chart not generated in R shiny when run locally using googleVis

以下是我为创建可视化国际象棋而创建的示例的屏幕截图数据。

Here's a screenshot of an example of one I've created to visualize chess data.

googlevis示例

这篇关于我如何用R中的Animation创建Shiny应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆