{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/shiny/issues/853","labels_url":"https://api.github.com/repos/rstudio/shiny/issues/853/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/shiny/issues/853/comments","events_url":"https://api.github.com/repos/rstudio/shiny/issues/853/events","html_url":"https://github.com/rstudio/shiny/issues/853","id":84474424,"number":853,"title":"Multiple column input into col.names from textInput - Bug","user":{"login":"calculus-ask","id":12711097,"avatar_url":"https://avatars.githubusercontent.com/u/12711097?v=3","gravatar_id":"","url":"https://api.github.com/users/calculus-ask","html_url":"https://github.com/calculus-ask","followers_url":"https://api.github.com/users/calculus-ask/followers","following_url":"https://api.github.com/users/calculus-ask/following{/other_user}","gists_url":"https://api.github.com/users/calculus-ask/gists{/gist_id}","starred_url":"https://api.github.com/users/calculus-ask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calculus-ask/subscriptions","organizations_url":"https://api.github.com/users/calculus-ask/orgs","repos_url":"https://api.github.com/users/calculus-ask/repos","events_url":"https://api.github.com/users/calculus-ask/events{/privacy}","received_events_url":"https://api.github.com/users/calculus-ask/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-03T10:02:48Z","updated_at":"2015-06-03T13:11:10Z","closed_at":null,"body":"If we input col.name = input$textinput in read.csv --> we are getting this bug... My sample file has three column without headers..\r\ni have tried with several iterations and thought to report as bug.\r\nI have raised in earlier post, since that issue has been closed i am posting as new issue..\r\n\r\n@wch please check.. cat is also not working\r\n\r\nlibrary(shiny)\r\n\r\nshinyServer(function(input, output,session) \r\n  {\r\n  output$contents <- renderTable({\r\n  \r\n          if (input$header== TRUE) \r\n          {\r\n            infile <- input$file1\r\n            if (is.null(input$file1)) {return(NULL)}\r\n            read.csv(infile$datapath)\r\n          }\r\n        else\r\n          {\r\n            infile <- input$file1\r\n            if (is.null(input$file1)) {return(NULL)}\r\n            cols <- cat(input$value)\r\n            read.csv(infile$datapath,header=FALSE,col.names=cols)\r\n          }\r\n      \r\n})})\r\n\r\nlibrary(shiny)\r\nshinyUI(fluidPage(\r\n  \r\n  titlePanel(\"The Ace!\"),\r\n           navbarPage(\"Calulus@Work\",  \r\n            tabPanel(\"About Tool\"\r\n                     ),\r\n            navbarMenu(\"Data Load\",\r\n                        tabPanel(\"Delimter\",\r\n                                 sidebarLayout(\r\n                                   sidebarPanel(fileInput('file1', 'Choose file to upload',\r\n                                               accept = c('text/csv',\r\n                                                 'text/comma-separated-values',\r\n                                                 'text/tab-separated-values',\r\n                                                 'text/plain','.csv','.tsv'\r\n                                               )),\r\n                                     checkboxInput('header', 'Header', TRUE),\r\n                                     textInput(\"value\",\"Enterhere\",\"\")\r\n                                     ),\r\n                                   mainPanel(\r\n                                     tableOutput('contents')))))\r\n                                                \r\n             \r\n             )#navbarPage\r\n  \r\n)#fluidpage\r\n)#shinyUI\r\n\r\nError:\r\n\"a\",\"b\",\"c\"\r\nError in read.table(file = file, header = header, sep = sep, quote = quote,  : \r\n  more columns than column names\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/shiny/issues/comments/108399406","html_url":"https://github.com/rstudio/shiny/issues/853#issuecomment-108399406","issue_url":"https://api.github.com/repos/rstudio/shiny/issues/853","id":108399406,"user":{"login":"calculus-ask","id":12711097,"avatar_url":"https://avatars.githubusercontent.com/u/12711097?v=3","gravatar_id":"","url":"https://api.github.com/users/calculus-ask","html_url":"https://github.com/calculus-ask","followers_url":"https://api.github.com/users/calculus-ask/followers","following_url":"https://api.github.com/users/calculus-ask/following{/other_user}","gists_url":"https://api.github.com/users/calculus-ask/gists{/gist_id}","starred_url":"https://api.github.com/users/calculus-ask/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calculus-ask/subscriptions","organizations_url":"https://api.github.com/users/calculus-ask/orgs","repos_url":"https://api.github.com/users/calculus-ask/repos","events_url":"https://api.github.com/users/calculus-ask/events{/privacy}","received_events_url":"https://api.github.com/users/calculus-ask/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T13:11:10Z","updated_at":"2015-06-03T13:11:10Z","body":"Tried using strsplit also..\r\n\r\nlibrary(shiny)\r\n\r\nshinyServer(function(input, output, session) \r\n{\r\n  \r\n  output$contents <- renderTable({\r\n    \r\n    if (input$header== TRUE)\r\n    {\r\n      infile <- input$file1\r\n      if (is.null(input$file1)) {return(NULL)}\r\n      read.csv(infile$datapath)\r\n    } \r\n    else \r\n      {        \r\n        infile <- input$file1\r\n        if (is.null(input$file1)) {return(NULL)}\r\n        tmp <- strsplit(input$value,\",\")\r\n        read.csv(infile$datapath,header=FALSE,col.names=tmp)       \r\n    }\r\n  })\r\n})\r\n\r\nError..\r\n\r\nError in read.table(file = file, header = header, sep = sep, quote = quote,  : \r\n  more columns than column names"}}