I’m writing to ask for your feedback.
I’m writing a code in shiny to input data in real time and download a csv file, but I want to remove rows with NA in the final output file.
Is it difficult to remove rows in real time in shiny?
Is it not implemented to remove them in real time, so I want to remove them during the process of downloading the file?
I’m attaching my code below.
Any help would be greatly appreciated.
output$table <- renderTable({
datasetInput()
})
observeEvent(input$downloadData, {
filename <- paste0('Ak', 'DM', input$id, '.csv')
dir.create(file.path(WD, paste0('DM', input$id)), recursive = TRUE)
file_path <- file.path(WD, paste0('DM', input$id), filename)
dat <- datasetInput()
clean_data <- na.omit(dat)
write.csv(clean_data, file_path, row.names = FALSE, quote = FALSE)
updateActionButton(session, "downloadData", label = "Download Complete", icon = icon("check"))
})
enter image description here
문경란 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.