创建一个弹出窗口,在访问闪亮的应用程序后显示,欢迎用户访问仪表板

Create a pop up that displays once shiny app accessed that welcomes the user to the dashboard

是否可以创建一个弹出窗口来欢迎用户访问闪亮的仪表板?此外,我希望他们能够在弹出 window 中点击一个按钮来关闭它。

理想情况下,弹出窗口会显示类似 "Welcome to the _______ Dashboard! If you are ready to continue, press okay!" 的内容。然后确定按钮将关闭弹出窗口 window.

根据@Gainz 的评论,您可以使用 shinyalert 或任何其他显示模态的方法,例如showModal(modalDialog(...)).

如果您在应用程序的服务器函数中调用它(没有 observeobserveEvent,只有 as-is),那么它将 运行 一次 user-session.

下面的最小示例:

library(shiny)
library(shinyalert)

ui <- fluidPage(

  useShinyalert()

)

server <- function(input, output, session) {

  shinyalert("Welcome", "Welcome to the ___ Dashboard!", type = "info")

}

shinyApp(ui, server)