传递动态输入并更新R闪亮的视觉效果

时间:2017-09-09 07:55:05

标签: r shiny shinydashboard

执行下面的脚本会创建一个带有select输入的process_map()。选择像" r1"," r2"等我们得到相应的流程图。但是,我想动态传递selectInput栏中的输入并更新R闪亮页面Snapshot for your reference中的流程图。请帮忙。

## app.R ##
install.packages("bupaR")
install.packages("edeaR")
install.packages("eventdataR")
install.packages("processmapR")
install.packages("processmonitR")
install.packages("xesreadR")
install.packages("petrinetR")
install.packages("shiny")
install.packages("shinydashboard")
library(shiny)
library(shinydashboard)
library(bupaR)
library(edeaR)
library(eventdataR)
library(processmapR)
library(processmonitR)
library(xesreadR)
library(petrinetR)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(

selectInput("resources","Select the resource", c("r1","r2","r3","r4","r5"), 
selected = "r1",selectize = T)
),
dashboardBody(
filter_resource(patients,resources = c("r1","r2","r4"), reverse = F) %>% 
process_map()
))
server <- function(input, output) { 
}
shinyApp(ui, server)

1 个答案:

答案 0 :(得分:2)

你可以做到

library(shiny)
library(shinydashboard)
library(bupaR)
library(edeaR)
library(eventdataR)
library(processmapR)
library(processmonitR)
library(xesreadR)
library(petrinetR)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(

selectInput("resources","Select the resource", c("r1","r2","r3","r4","r5"),selected = "r1",selectize = T)
),
dashboardBody(
  uiOutput("ui")
))
server <- function(input, output) { 
  output$ui <- renderUI({
    r <- input$resources
    tagList(filter_resource(patients,resources = r, reverse = F) %>% process_map())
  })
}
shinyApp(ui, server)