Error reading R script (),system error 2 when trying to run R Studio on Mac

Viewed 23547

I installed R Studio desktop in my MacBook air running on Big Sur. Unfortunately, it cannot run due to the error below:

Error reading R script (),system error 2 (No such file or directory); Unable to find libR.dylib in expected locationswithin R Home directory /Library/Frameworks/R.framework/Resources

enter image description here

4 Answers

Running brew install R solves the problem for me.

A similar question was asked on the R Studio community.

  • You need to first download base R:

    • Choose the latest version from here, under the Latest release header. For example, R-4.1.0.pkg.
  • Then download R Studio for MacOS from here.

You have probably installed Rstudio before installing R. What you can do is to first install R using brew install R and then reinstalling Rstudio using brew reinstall rstudio.

To add to all above info, with recent releases of MacOS we will have to install XQuartz before installing R. After these installations, proceed with RStudio installation.

Related