不能将类型'环境'强制转换为'字符'类型的向量

时间:2016-06-08 10:33:49

标签: r shiny

我正在尝试创建一个闪亮的交互式UI来读取文件,但我收到了以下错误:

  

不能将“环境”强制类型为'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 个答案:

答案 0 :(得分:3)

shinyApp来电中有拼写错误。试试这个:

shinyApp(ui= ui, server = shinyServer)
相关问题