这似乎是一个非常明显的问题,但我还没有找到任何关于这个主题的东西。
如何刷新闪亮的应用程序(相当于按 F5,或单击 RStudio 中的“重新加载应用程序”按钮)?
用户界面
shinyUI(pageWithSidebar(
headerPanel("Example"),
sidebarPanel(
actionButton("goButton", "Refresh")
),
mainPanel(
h4("I would really like to refresh this please.")
)
))
服务器.R
shinyServer(function(input, output,session) {
observe({
if(input$goButton==0) return(NULL)
isolate({
#
# I would like to refresh my session here with some sort of
# function like session(refresh)...
})
})
})
我不认为我想使用 stopApp() - 我只想刷新它,使其处于与加载时相同的状态。
更新
在 RStudio 网站上,它在这里展示了如何从服务器管理用户的会话。具体来说,
$ sudo rstudio-server suspend-session <pid>
在应用程序中是否有与用户等效的功能?在会话信息(此处)的文档中,它说有一个 onSessionEnded(callback) 函数。如果有一个 session.End() 函数来执行上述挂起会话功能,那就太好了!