Is there an upper limit of code in R

No, there is no such limit, could you prepare a reproducible example (reprex) illustrating your issue? Please have a look at these resources, to see how to create one for a shiny app