我试图在GUI中显示外部函数中定义的向量。从服务器功能调用外部函数。这是行不通的。我做错了什么?
ui <- fluidPage(
mainPanel(
conditionalPanel(
condition = "output.pipe",
helpText("YOUR PIPELINE"),
textOutput("pipe")
)
)
)
Value <- function(filename){
pnames = c("One", "Two", "Three", "Four")
}
server <- function(input, output){
output$pipe <- reactive({
result <- Value(inFileName)
pipeLine <- result$pnames
output$pipe <- renderText({
paste("Attention ", pipeline)
})
return(pipeLine)
})
outputOptions(output,"pipe", suspendWhenHidden = FALSE)
}
答案 0 :(得分:0)
该函数没有重新调整任何值,因为它是在块外定义的inFilename是定义的。
output$contents <- renderTable({
if(input$btn){
hide("btn")
}
inFile = input$file
inFileName = input$file$name
if(is.null("inFile")){
return()
}
output$pipe <- reactive({
result <- glycoPipe(inFileName)
#pname <- c("One", "Two", "Three", "Four")
pipeLine <- result$pnames
output$textBox <- renderText({
paste("Attention ", pipeLine)
})
return(pipeLine)
})
outputOptions(output, "pipe", suspendWhenHidden = FALSE)
})