how to save miniUI output [variable and dataframe]


I write a miniUI to create a dataframe.

how to save the dataframe output after I close the miniUI(shiny Gadget UI) ?

My purpose is create a new dataframe by filter a old dataframe using miniUI

for example , how can I call the [output$table] after i close miniUI(shiny Gadget UI) ?

  output$table <- renderTable({

Thank you

There are two things you will need to do:

  1. Add an observer that listens for input$done and calls stopApp(). The value that is passed to stopApp() will be returned when the application exits
  2. Add a reactive that returns the data you want, and use that in both output$table <- renderTable() and the stopApp().

For example:

server <- function(input, output, session) {
  mydata <- reactive({
    select_var001 <- input$select
    where_var001 <- 
    sql <- make_sql(select_var001, where_var001)

  output$table <- renderTable({

   # Return mydata() when the user clicks on Done
   observeEvent(input$done, {

See the simple example here:

Thank you so many for answering my question. the mytable() should be mydata()

And it did return the data frame . But How can I assign the dataframe to a variable instead of just print it out ?

You just need to assign it when you invoke the app, as in:

x <- myGadget()

solved! wrap it as a function as myGadget() and then assign to x

thanks a lot.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.