2016-06-08 29 views
0

我試圖做一個閃亮的交互式用戶界面讀取文件的載體,但我得到以下錯誤:不能強制型「環境」類型爲「字符」

代碼

cannot coerce type 'environment' to vector of type 'character'

部分使用同樣是:

library(shiny) 

ui= fluidPage(
    titlePanel("TF-IDF") 
    sidebarLayout(
    sidebarPanel(
     fileInput("file", "Upload the File ") 
    ), 
    mainPanel(
     uiOutput("contents") 
    ) 
    ) 

) 

shinyServer= function(input,output){ 
    datain1= reactive({ 
    file1= input$file 
    if(is.null(file1)){return()} 
    read.table(file=file1$datapath, sep= input$sep, header= input$header , stringsAsFactors = input$stringAsFactors) 
    } 

) 
} 

shinyApp(ui= shinyUI, server = shinyServer) 

回答

1

您的shinyApp調用中存在輸入錯誤。試試這個:

shinyApp(ui= ui, server = shinyServer) 
相關問題