rshiny-server

Variable names are limited to 10000 bytes


I am getting error while running the code in shiny-server only. When I am running the same code from R console using runApp() function it is running well. See the error message below....

Warning: Error in assign: variable names are limited to 10000 bytes
Stack trace (innermost first):
    46: assign
    45: wrapFunctionLabel
    44: public_bind_env$initialize
    43: Observable$new
    42: reactive
    41: templateServer
    40: server [/home/shiny-apps/ACCPlantAnalysis/server.R#20]
     1: runApp
Error in assign(name, func, environment()) : 
  variable names are limited to 10000 bytes

Line no 41 and 40 are written by me. but other lines are not written by me; call from any reference library. I don't know from which library.


Solution

  • At last I got solution. I wrote functions for every 'if' block and put all code of 'if' block inside the function. Then call the function. And the was problem solved.

    SectoralLeverageRatio(){
    ...
    ...
    }
    
    if (selectedIndex=="Sectoral Leverage Ratio"){
      SectoralLeverageRatio()
    }
    

    The conclusion is... if your 'if' block is large enough and you got 'variable names are limited to 10000 bytes' error. Replace the code inside the 'if' block with user defined function.

    This is the problem of shiny-server; not the problem of 'R'. If you run your code from 'R' console using runApp(), you would not get any error. But if you run through(production environment) you might get an error.