Error in shiny R Warning Error in read table file must be a character string or connection

0 votes

This is my code in shiny R

ui.R:

fileInput("f1", 
                  "Load Input File", 
                  accept = c("text/csv", "text/comma-separated-values,text/plain",".csv")
        )

server.R:

execute = observeEvent(input$runButton, {
    output$plot1 = renderPlot({
        inFile = input$file1
        if (is.null(inFile)) {
            print(NULL)
        }
        podr_fun_graphs(inFile$datapath)
    })
}

podr_graphs function:

podr_fun_graphs <- function(p) {

    df1 <- read.delim(p, sep = "\t")
}

and I end up with the following error:

Warning: Error in read.table: 'file' must be a character string or connection
Dec 5, 2018 in Data Analytics by Ali
• 11,360 points
4,730 views

1 answer to this question.

0 votes

Your if statement in the server.R is wrong. It should be like this:

if (is.null(inFile)) {
     return(NULL)
   }
answered Dec 5, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

How can I read a .csv file in R language?

read.csv () function is used to read ...READ MORE

answered Jun 12, 2018 in Data Analytics by zombie
• 3,790 points
549 views
+1 vote
1 answer
+1 vote
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,840 points
2,348 views
+1 vote
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 29, 2018 in Data Analytics by Maverick
• 10,840 points
3,165 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP