I want to read a data.frame from file and then use it for making plots later on. The problem is that when I read the data, it is part of an output Object and can not be used
Make use of the reactive function :
Make the following changes in the server part of your App
library(shiny)
shinyServer(function(input, output) {
mydata <- reactive({
inFile <- input$file1
if (is.null(inFile))
return(NULL)
tbl <- read.csv(inFile$datapath, header=input$header, sep=input$sep, dec = input$dec)
return(tbl)
})
output$table.output <- renderTable({
mydata()
})
output$plot1 <- renderPlot({
x <- mydata()[,1]
plot(x)
})
})