title: R shiny: How to get an reactive data frame updated each time pressing an actionButton without creating a new reactive data frame?
body: <p>My shiny app allows user to upload a csv by using <strong>fileInput</strong> and stored as an reactive object df_data. I then created a numericInput for user to enter a row number to delete from the data frame. However, I got an error about <strong>evaluation nested too deeply: infinite recursion / options(expressions=)?</strong>.</p>
  
  <p>Below is my code for ui.R.</p>
  
  <pre><code>shinyUI(fluidPage(
    titlePanel("amend data frame"),
  
    mainPanel(
      fileInput("file", "Upload file"),
  
      numericInput("Delete", "Delete row:", 1, step = 1),
      actionButton("Go", "Delete!"),
  
      tableOutput("df_data")
    )
  ))
  </code></pre>
  
  <p>And below is my code for server.R.</p>
  
  <pre><code>shinyServer(function(input, output) {
    df_data &lt;- reactive({
      read.csv(input$file$datapath)
    })
  
    df_data &lt;- eventReactive(
      input$Go,
      df_data()[-input$Delete,]
    )
  
    output$df_data &lt;- renderTable(df_data())
  })
  </code></pre>
  
  <p>I have solved the problem by assigning the subsetted data frame to a new reactive data frame called, say, df_data2. But I want to make the user able to keep deleting different rows by inputting values in <strong>Delete row</strong> and press the <strong>Go</strong> button. Then this solution will not work as I will have to assign df_data3, df_data4 ... and I couldn't predict in advance how many times the user will press the <strong>Go</strong> button.</p>
  
  <p>I am a new user to shiny for about 2 weeks and I have been searching for solutions about this for a week. Is there anyone who can help me? A million thanks !!</p>