title: When using Reactive function in R shiny with optional user inputs, why is the reactive base object reduced when there is no user input?
body: <p>The below MWE code generates a simple 1-column, 4-row optional (and reactive) input matrix for the user. The user may optionally change any of the values in the input matrix. The default matrix has values of 0.20 in each field. The user may over-write any of these values in creating a new matrix.</p>
  <p>The below line of code <code>observeEvent(base_input(), {base_input.R &lt;&lt;- unique(base_input())})</code> generates a global variable of the matrix values, for testing purposes in other parts of the larger App that this MWE derives from.</p>
  <p>This works fine when the user inputs changed values into the matrix. Run the App and after typing in new matrix values, simply type &quot;base_input.R&quot; into the R studio console and it outputs those user inputs.</p>
  <p>However, when the user doesn't input any values into the matrix, the object &quot;base_input.R&quot; now only shows the 1st row of that default matrix (row A with a value of 0.20). Why is this? And how do I change it so the 4-row default matrix appears as the &quot;base_input.R&quot; global variablewhen there is no user input?</p>
  <pre><code>library(shiny)
  library(shinyMatrix)
  
  ui &lt;- 
    matrixInput(
      &quot;base_input&quot;,
      value = matrix(c(0.2), 4, 1, dimnames = list(c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;),NULL)),
      rows = list(extend = FALSE,  names = TRUE),
      cols = list(extend = FALSE, names = FALSE, editableNames = FALSE),
      class = &quot;numeric&quot;)
    
  server &lt;- function(input,output)({
    base_input &lt;- reactive(input$base_input)
  # Below generates global variable of matrix values for testing purposes
    observeEvent(base_input(), {base_input.R &lt;&lt;- unique(base_input())})
  }) # close server  
    
  shinyApp(ui, server)  
  </code></pre>