suppose I have a data object that is uploaded by the user:
data <- reactive({
inFile <- input$file
if (is.null(inFile)) return(NULL)
data <- read.csv(inFile$datapath)
return(data)
})
And suppose I want to delete columns in the dataset. I want to set it to global assignment so that I can run the UI multiple times and have each effect saved in the object.
dataset <- reactive({
file1 <- data()
file1[,input$deletecols] <<- NULL
return(file1)
}}
})
However, when I run this, I get the error:
invalid (NULL) left side of assignment
What's causing this error? and how can I achieve this effect if global assignment doesn't work?
Thanks very much.