R “for loop” error messages {}

后端 未结 3 1014
死守一世寂寞
死守一世寂寞 2020-12-04 03:58

Since a couple of days ago when I run a for loop in R it gives me plenty of errors related to \"}\". It only happens if I highlight the whole code and run it. If i execute i

3条回答
  •  难免孤独
    2020-12-04 04:39

    I am also using Rstudio and get the same error message when running for loops.

    Error: unexpected '}' in "}"
    

    If I source the file, like this...

    source('~/.active-rstudio-document')
    

    or if I simply click the "source" button in the GUI, I don't get the same error message.

    If sourcing the whole R script is not an option, consider copying the for loop to another file and sourcing that.

提交回复
热议问题