为了向我的应用程序添加免责声明,我想在应用程序启动时显示一条带有showNotification().
用户不必按下按钮(如下所示)即可显示消息。
shinyApp(
ui = fluidPage(actionButton("show", "Show")),
server = function(input, output) {
observeEvent(input$show, {
showNotification("This is a notification.")
})
})
Run Code Online (Sandbox Code Playgroud)
改成observe
observe({
showNotification("This is a notification.")
})
Run Code Online (Sandbox Code Playgroud)