0

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.

Nabi Shaikh
  • 787
  • 1
  • 6
  • 26
  • 3
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. But the first error in your log refers to a missing closing `"`. This would cause the R parser to incorrectly interpret all subsequent code. Fix that error first. – MrFlick Feb 08 '18 at 18:39
  • 1
    The example code you shared is not properly inside a `reactive()` or anything else. On line 71 of the code you posted you have the closing `}` but no matching `)` so then you have a bunch of code starting on line 72 that shiny expects to be separated by commas when in reality you've simply not properly enclosed. – Mark Feb 08 '18 at 18:41
  • @MrFlick i agree with you , if their would have been error with missing `"` then i there would have some flag of error , neither it is showing that hint . – Nabi Shaikh Feb 09 '18 at 04:46
  • @Mark . for (i2 in 1:length(z)){ # s[[i2]] <- as.li2st(z[[i2]][5])} s[[i2]] <- as.list(paste(z[[i2]][5],z[[i2]][6]))} are talking about this line – Nabi Shaikh Feb 09 '18 at 05:02

1 Answers1

0

Save the file to UTF 8 encoding format.

Here is the instruction to solve the above problem

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

Nabi Shaikh
  • 787
  • 1
  • 6
  • 26