r - 将仪表板呈现为 htmlOutput
问题描述
我正在尝试制作一个多页面应用程序,但问题是我没有从应该将我重定向到应用程序页面的按钮得到反应,这是我的代码:
library(shiny)
library(shinyjs)
library(shinythemes)
library(shinydashboard)
render_page <- function(..., f) {
page <- f(...)
renderUI({
fluidPage(page, title = title)
})
}
ui_index <- function(...) {
basicPage(
actionButton("go","Go to App")
)
}
ui_app <- function(...){
dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody()
)
}
ui <- (htmlOutput("page"))
server <- function(input, output, session){
output$page <- render_page(f = ui_index)
observeEvent(input$go,{
output$page = render_page(f = ui_app)
})
}
shinyApp(ui = ui,server = server)
解决方案
推荐阅读
- php - Laravel / Eloquent / Postgres:更新查询导致错误“无效参数号:未定义参数”
- ios - 按需资源 (ODR) 已完成/已下载标签的总文件大小
- flask - ModuleNotFoundError:Flask-sqlalchemy 中没有名为“MySQLdb”的模块
- sql - SQL 查询形成双对
- azure - Azure Synapse 加载:将大型压缩文件拆分为较小的压缩文件
- jboss - 读取卡在 HornetQ 中的大消息文件 (*.msg)
- c++ - 将 GetComputerNameA 的输出存储在 C++ 中的结构中
- apache-flink - 我们是否有可能在 Apache Flink 中创建一个可供所有操作员访问的对象?
- python - 无法向设备 ID 中带有“:”的单元发送消息到 Azure IoT 中心
- java - How to get private key from jks keystore for signing the message with privatekey using shal256rsa in java