as.vector中的R闪亮错误:无法将类型'closure'强制转换为类型为'character'的向量

时间:2019-01-19 02:27:11

标签: r

我想知道是否有人可以帮助我解决以下问题

ui = fluidPage(
      mainPanel(
       .......
       fluidRow(
             textInput("res",h4("size")) 
             )
          )
      )
server = function(input,output){
         index1 = reactive({...})
         index2 = reactive({...})
         index3 = reactive({...})
         index4 = reactive({...})
observe({
   x = renderText(
       if(input$selc2=="EMT"){
       as.character(EMT[index1(),2])
   }else if(input$selc2=="SUS-304"){
           as.character(SUS[index2(),2])
        }else if(input$selc2=="RSG"){
           as.character(RSG[index3(),2])
        }else{
           as.character(PVC_p[index4(),2])
        }
        )
})
    updateTextInput("res",
                   value = paste(x))
}

我正在尝试更新textInput值,但它始终显示

error in as.vector: cannot coerce type 'closure' to vector of type 'chracter' EMT,SUS,RSG,PVC_p是.csv文件

0 个答案:

没有答案