Search code examples
rstringshinyshiny-servershinydashboard

For Loop Not working in server.r on shiny inside reactive function


I am trying to execute a chunk of R code inside a reactive function, and in the reactive function, I have a couple of For loop written. It is showing as an unambiguous error in spite the syntax for For loop is Correct. I am unable to find whats wrong with the Code.

Error message in the console after executing the above code shiny application

enter image description here

Here in the image as we can see the ^ in the for loop syntax, whats wrong with this I am unable to identify the problem.


Solution

  • Save the file to UTF 8 encoding format.

    Here is the instruction to solve the above problem

    https://shiny.rstudio.com/articles/unicode.html