Try like this in a fresh kernel:
Needs["RLink`"]
SetEnvironment["DYLD_LIBRARY_PATH" -> "/Library/Frameworks/R.framework/Resources/lib"];
InstallR["RHomeLocation" -> "/Library/Frameworks/R.framework/Resources"];
Update: With Mathematica 10.0.1 (but not 10.0.0), use
InstallR["RHomeLocation" -> "/Library/Frameworks/R.framework/Resources", "RVersion" -> 3]; (* for M 10.0.1 *)
This works if you are using the R distribution from http://www.r-project.org/, but if I recall correctly some people said it didn't work with some other R distributions (e.g. MacPorts's R). I only tried with the official R.
To check that you are indeed running with the chosen version of R, evaluate
REvaluate["R.version.string"]
which on my system returns {"R version 3.0.3 (2014-03-06)"}
(as I have R 3.0.3).
I described this before here.
Note: With Mathematica 9.0.1 it is necessary to first make sure that RLink is set up and working with Mathematica's internal R distribution, as described in the user guide. Once that is done, an external R can be used as above. Otherwise InstallR
might exit with an InstallR::nopaclet
error.
R.home()
reports. $\endgroup$IGraphR.m
is really in the right folder, and you get this message, then you don't have the correctIGraphR.m
file. Try downloading it again from here $\endgroup$