0 votes
1 view
in R Programming by (13.5k points)

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

1 Answer

0 votes
by (33.1k points)

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

if (is.null(inFile)) {

     return(NULL)

   }

Hope this answer helps you!

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...