I have the following error showing up in Rstudio when I run the code below:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
redun.formula <- formula(paste("~", paste0("X", seq(1:2500), collapse = "+")))
I have tested it on 3 computers (2 OSX and 1 Windows) with recent (different but all 2023) versions of RStudio and R and more than 32GB memory each with the same result. Furthermore, if I try to open a project created a year ago with formulas with many variables, I get the same error when I try to load the .Rdata file, when it used to work perfectly.
On the other hand, the same line of code works with no issue if I run it in a R console.
I have tried to set a larger value than the default one in options(expressions=) as suggested in a few posts talking about this error, and this yields to a different error: Error: C stack usage 7954392 is too close to the limit
Since I have updated RStudio on all computers where the command used to work, I am suspecting there have been a breaking change in one of the updates, but I have no clue what happened nor what I can do to solve the issue. Any suggestion would be welcome.