title: Inserting reactive values in ReactiveValues
body: <p>I have the following Shiny App</p>
  
  <pre><code>server &lt;- function(input, output, session) {
    rv &lt;- reactiveValues(i = 0)
  
    output$myplot &lt;- renderPlotly({
      dt = data.frame(x = 1:10, y = rep(rv$i,10))
      plot_ly(dt, x = ~x, y =~y, mode = "markers", type = 'scatter') %&gt;%
        layout(yaxis = list(range = c(0,10)))
    })
  
    observeEvent(input$run,{
      rv$i &lt;- input$valstart
    })
  
    observe({
      isolate({rv$i = rv$i + 1})
      if (rv$i &lt; 10){invalidateLater(1000, session)}
    })
  }
  
  ui &lt;- fluidPage(
    sliderInput('valstart','Start Value', min = 1, max =3, value= 3),
    actionButton("run", "START"),
    plotlyOutput("myplot")
  )
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>I would, however that the value of rv at the beginning when I launch the app to depend on a parameter (here my slider input). I would like something like that:</p>
  
  <pre><code>rv &lt;- reactiveValues(i = input$valstart)
  </code></pre>
  
  <p>But this give me the following error :</p>
  
  <blockquote>
    <p>Error in .getReactiveEnvironment()$currentContext() :    Operation not
    allowed without an active reactive context. (You tried to do something
    that can only be done from inside a reactive expression or observer.)</p>
  </blockquote>
  
  <p>It seems that I can't insert reactive values inside reactiveValues... any solution?</p>