【问题标题】:Update Shiny App Data without republishing App?在不重新发布应用程序的情况下更新闪亮的应用程序数据?
【发布时间】:2017-10-14 08:40:25
【问题描述】:

我目前正在使用 RStudio 中的 Leaflet 和 Shiny 包为雇主创建一个 Shiny 应用程序。我正在制作一张地图,显示即将举行的选举的预测。这些预测变化非常频繁,地图将不得不改变以适应这些波动。我们将把地图托管在私人服务器上(不是 shinyapps.io)。

目前,我将投影数据作为 CSV 加载到 RStudio,然后将其与选区的 Shapefile 合并:

  projection_data <- read.csv("./Data/projection_data.csv")
  elect_districts <- shapefile("./Data/ed_simple.shp")
  ed_projection <- merge(elect_districts, projection_data, by='ED_ID')

是否可以更新 CSV 文件并将这些更改显示在已发布的应用程序中,而无需重新发布应用程序?

我希望使更新过程尽可能简单,因为在我完成这项任务后,我的雇主会更新地图。

The projection data is very simple. We have the name of the district and the projected winner. The projected winner (party_prob) is the variable that will need to be updated.

【问题讨论】:

  • 您应该将数据库连接到应用程序,该应用程序将定期请求更新其所需数据。
  • 您找到解决方案了吗?

标签: shiny rstudio shiny-server


【解决方案1】:

只需在 R 控制台中编写这两行代码。会更新的。

library(rsconnect)
rsconnect::deployApp( local_path_of_your_app )

【讨论】:

  • 这不算重新发布应用,OP不想做吗?
猜你喜欢
  • 2017-12-05
  • 2016-06-24
  • 2017-12-12
  • 1970-01-01
  • 1970-01-01
  • 2017-08-10
  • 2018-07-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多