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
• 10,290 points
345 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,000 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 11, 2018 in Data Analytics by zombie
• 3,690 points
18 views
0 votes
1 answer
0 votes
1 answer

Error saying " cannot open the connection" when trying to install a package in R

Try install.packages(“package_name”, repos="http://cran.us.r-p ...READ MORE

answered Nov 26, 2018 in Data Analytics by Maverick
• 10,000 points
154 views
0 votes
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,000 points
238 views
0 votes
1 answer

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

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

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,000 points
131 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.