How to run code to uploaded dataset when press an actionButton in R shiny

... am doing a shiny app that allows user to upload data and preprocess it and plot some maps , my question is how to do that using observeEvent function to preprocess it and plot data. my code on server side is:-

bserveEvent(input$clean, {
#vals <- reactiveValues()
vals$long_code_out <- long_code()
showModal(modalDialog("calculation finished!"))