After user has uploaded the TDMS file, I need to display its Signals in a Datatable, reactively...meaning when new TDMS file is being uploaded, that Signals in the Datatable is updated accordingly.
df_TDMS_upload <- reactive({
inFile <- input$upload
if (is.null(input$inFile))
return(NULL)
f <- file(paste0('/srv/shiny-server/data/',input$upload[1]), 'rb')
main <- TdmsFile$new(f)
main$read_data(f, 0, 4000, sample_rate = 1)
mainObjectList <- as.list(main$objects)
close(f)
Signals <- as.data.frame(names(mainObjectList))
return(Signals)
})
output$Signal_table <- DT::renderDataTable({
Signals <- df_TDMS_upload()
DT::datatable(Signals)
})
I am surprised why this does not work, it seems simple, and where is exactly the issue that it does not work?
I have debugged line by line, and when put in that filename for the tdms file, that Signals dataframe is available.