title: How can we use `names()` or an alternative to name `reactiveVal` inside Shiny app?
body: <p>I tried to use <code>names()</code> on a <code>reactiveVal</code> inside a shiny app without success.</p>
  
  <hr>
  
  <p>Is this even possible? What are alternative ways to <em>name</em> reactive values in shiny apps?</p>
  
  <hr>
  
  <p>My first attempt throws an error:</p>
  
  <pre><code>names(r()) &lt;- "something"
  </code></pre>
  
  <blockquote>
    <p>Error in names(r()) &lt;- "something" :    invalid (NULL) left side of
    assignment</p>
  </blockquote>
  
  <p>My second attempt as well:</p>
  
  <pre><code>names(r) &lt;- "something"
  </code></pre>
  
  <blockquote>
    <p>Error in names(r) &lt;- "something" : names() applied to a non-vector</p>
  </blockquote>
  
  <hr>
  
  <p>Here is a minimal example app:</p>
  
  <pre><code>library(shiny)
  
  ui &lt;- fluidPage(mainPanel(textOutput("text")))
  
  server &lt;- function(input, output) {
    r &lt;- reactiveVal(1)
    # names(r) &lt;- "something"
    output$text &lt;- renderText(
      paste0("The reactiveVal is ", r(),". It's name is ", names(r()),"."))
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>