When starting up the RStudio IDE on OS X or Linux, you may see an error similar to the following:
ERROR: r error 4 (R code execution error)
[errormsg=Error in identical(call[[1L]];
7 arguments passed to .Internal(identical) which requires 5
, code=local ....
ERROR r error 4 (R code execution error) [errormsg=Error in file(filename, "r", encoding = encoding) : ||| 5 arguments passed to .Internal(file) which requires 6
Typically when we see this problem, it’s caused by a conflict between multiple versions of R installed on your computer. RStudio is receiving information from at least two different versions of R, and it is unable to start as a result.
To solve this issue, we recommend the following:
On Linux, this typically indicates that the R version is being set somewhere in the operating system's environmental variables - then when another R version is launched, RStudio receives info from two different versions of R. We'd recommend checking the environment and all startup files as described here to make sure that no R-specific environment variables are set. If you're trying to set up multiple versions of R with RStudio Workbench (previously RStudio Server Pro), make sure you're doing so following our instructions here.
On OS X, we recommend navigating to the folder
/Library/Frameworks/R.framework/Versions/ and removing any versions of R that you don’t wish to use (you can move them to another folder if you think you might want to use them later).