title: How to create mutually dependent numeric Input in Shiny?
body: <p>Please find the working code below.
  Basically, there are 3 numericInputs which allows the user to change anyone at a time and the other 2 should adapt themselves resulting in 1</p>
  
  <p><strong>A + B + C = 1</strong>
  However, since they are interlinked, they seems to be unstable.
  How can we make it stable and allow the user to change any 1 variable: A  and other 2 change themselves summing to 1.</p>
  
  <p>Based on the answer here, created a working code as shown below:</p>
  
  <p><a href="https://stackoverflow.com/questions/42810324/connect-mutually-dependent-shiny-input-values">Connect mutually dependent shiny input values</a></p>
  
  <p><a href="https://stackoverflow.com/questions/30852816/dependent-inputs-in-shiny-application-with-r">Dependent inputs in Shiny application with R</a></p>
  
  <pre><code>library(shiny)
  ui &lt;- shinyUI(fluidPage(
    titlePanel("Mutually Dependent Input Values"),
    sidebarLayout(
      sidebarPanel(
        numericInput("A", "A",.333),
        numericInput("B", "B",.333),
        numericInput("C", "C",.333)
      ),
      mainPanel(
        verbatimTextOutput("result")
      )
    )
  )) 
  server &lt;- shinyServer(function(input, output,session) {
  
    observeEvent(input$A,{
      newB &lt;- 1 - input$A - input$C 
      updateNumericInput(session, "B", value = newB) 
      newC &lt;- 1 - input$A - input$B 
      updateNumericInput(session, "C", value = newC) 
    })
    observeEvent(input$B,{
      newC &lt;- 1 - input$B - input$A 
      updateNumericInput(session, "C", value = newC) 
      newA &lt;- 1 - input$B - input$C 
      updateNumericInput(session, "A", value = newA) 
    })
    observeEvent(input$C,{
      newA &lt;- 1 - input$C - input$B 
      updateNumericInput(session, "A", value = newA) 
      newB &lt;- 1 - input$C - input$C 
      updateNumericInput(session, "B", value = newB) 
    })
  
  
  })
  shinyApp(ui,server)
  </code></pre>
  
  <p>Basically, user will be free to update any of the numericInput: A, B or C. Other 2 numericInput should adapt itself to sum up to 1.
  Currently, since they are interlinked, they seems to be unstable (please find the above code to regenerate the error)</p>
  
  ####### Different approach with own solution
  
  <pre><code>
  ui &lt;- fluidPage(
    column(6, 
           tags$h2("Set parameters"),
           numericInput("valueA", "Value1", value = .333, min = 0, max = 1, step = .1),
           numericInput("valueB", "Value2", value = .333, min = 0, max = 1, step = .1),
           numericInput("valueC", "Value3", value = .333, min = 0, max = 1, step = .1)
    ),
    column(6,
           uiOutput("ui")
    )
  )
  
  server &lt;- function(input, output, session) {
    output$ui &lt;- renderUI( {
      tagList(
        tags$h2("Display in %"),
        numericInput("obs1", "Label1", value = 100 * (input$valueA / (input$valueA + input$valueB + input$valueC))),
        numericInput("obs2", "Label2", value = 100 * (input$valueB / (input$valueA + input$valueB + input$valueC))),
        numericInput("obs2", "Label2", value = 100 * (input$valueC / (input$valueA + input$valueB + input$valueC)))
      )
    })
  }
  
  shinyApp(ui, server)   
  
  </code></pre>