Я думаю, что если вы позволите панелям определять условия на основе пользовательского ввода, вы можете получить желаемую функциональность:
ui<-shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
radioButtons("p", "separate input files or consolidated?",
list("Single file"='a', "Separate files"='b'))
),
mainPanel(
conditionalPanel(
condition ="output.dual == 'a' " ,
fileInput("file1","Choose Consolodated file",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv","sas7bdat")
)
),
conditionalPanel(
condition ="output.dual == 'b' " ,
fileInput("file1","Choose Test file",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv","sas7bdat")
)
),
conditionalPanel(
condition = "output.dual == 'b'",
fileInput("file2", "Choose control file",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv","sas7bdat")
)
),
conditionalPanel(
condition = "output.dual == 'b'",
checkboxInput('headercheckbox',
"Files have different headers?",
value = FALSE
)
)### bracket close of conditional panel
)
)
))
server<-shinyServer(function(input, output) {
output$dual <- reactive({ input$p })
outputOptions(output, 'dual', suspendWhenHidden = FALSE)
})
shinyApp(ui,server)