purpose
To load a file into a Shiny application that reads data, name the variables (columns) and do some data analysis before presenting the graph output
Link Brilliant app
I use this app from the Shiny Gallery as a link: enter a description of the link here
What I tried:
I want to use the downloaded data on many outputs after performing various analyzes. So, instead of reading the file inside renderTableor renderPlot, I read it in a function server:
server <- function(input, output) {
inFile <- reactive({input$file1})
sdf <- reactive({read.csv(inFile()$datapath, header=F)})
colnames(sdf()) <- c('Vehicle.ID', 'Time', 'Vehicle.class.no', 'Vehicle.type2',
'Vehicle.Length', 'Lane', 'Preceding.Vehicle.ID', 'Spacing','Spacing2', 'State',
'svel.mps', 'deltaV.mps', 'sacc', 'lane.change') }
Error
But when I run this application, I get:
brilliant :: runApp ('app-CC')
Listening on http:
Error in colnames(sdf()) <- c("Vehicle.ID", "Time", "Vehicle.class.no", :
invalid (NULL) left side of assignment
Question
? render*. - , , , - render*?