title: Error in panel$intname : $ operator is invalid for atomic vectors
body: <p>I am working on the r panel package. Now if I have a function that uses a radiogroup button, and if i attempt to run the function from inside the rpanel menu, I get this error:</p>
  
  <pre><code>Error in panel$intname : $ operator is invalid for atomic vectors
  </code></pre>
  
  <p>However if I run the function per sé i.e. not from inside the rpanel menu, but by calling it independently, the above error doesn't appear. Here is a simple example. Try in 2 ways (1) run the whole code and click on Addition and then click Add in the menu (2) run the add function alone and call with add(). The former results in the above error and the latter doesn't.  Also, i saw that this error comes only when i have a rp.radiogroup in my panel.</p>
  
  <p>I saw the post in <a href="https://stackoverflow.com/questions/9824268/why-doesnt-r-allow-operator-on-atomic-vectors">Why doesn&#39;t R allow $ operator on atomic vectors?</a> but how do i solve my issue? My sample Code is below:</p>
  
  <pre><code>install.packages(c("rpanel","tkrplot"))
  my.menu &lt;- function(panel) {
  
  library(rpanel,tkrplot)
  
  if (panel$menu=="Add"){
  add()
    }
  else 
  panel
  }
  
  
  main.panel &lt;- rp.control(title = "Main Menu",size=c(200,150))
  rp.menu(panel = main.panel, var = menu,
      labels = list(list("Addition", "Add")),action = my.menu)
  
  
  #  function to do adddition
  
  add &lt;- function(){
  
  my.draw &lt;- function(panel) {
   if(panel$vals=="numbers"){
    val&lt;-as.numeric(panel$nmbr1)+as.numeric(panel$nmbr2)
   }
  else if(panel$vals=="strings"){
    val &lt;- paste(as.character(panel$nmbr1), "and" ,as.character(panel$nmbr2))
  }
  plot(1:10, 1:10, type="n", xlab="", ylab="",
  axes=FALSE, frame = TRUE)
  text(5, 5, paste("Result: ", val),cex=1.4)
  panel
  }
  
  
  
  my.redraw &lt;- function(panel) {
  rp.tkrreplot(panel, my.tkrplot)
   panel
  }
  
  my.panel &lt;- rp.control(title = "Addition")
  rp.textentry(panel = my.panel, var = nmbr1,
   labels = "First:     ", action = my.redraw, initval="100")
  rp.textentry(panel = my.panel, var = nmbr2,
             labels = "Second:", action = my.redraw, initval="200")
  rp.radiogroup(panel = my.panel, var = vals,
              values = c("numbers", "strings"),
              action = my.redraw, title = "Type")
  rp.tkrplot(panel = my.panel, name = my.tkrplot, plotfun = my.draw)
  }
  </code></pre>