![]() ![]() Of course having to jump through all these hoops every time one loads RLink is rather inconvenient. To verify that it is using the expected R installation. On some distributions it may also be necessary to amend LD_LIBRARY_PATH along the lines of SetEnvironment. On Ubuntu it is generally /usr/lib/R, while on Fedora it may be /usr/lib64/R. The specific location of R will vary by distribution. Generally, simply providing "RHomeLocation" will work.įor Mathematica 9.0.0, 9.0.1 and 10.0.0, use InstallR On Linux, the procedure varies by distribution. The setting "RVersion" -> 3 is sufficient regardless of which 3.x version you have installed. Then for Mathematica 9.0.0, 9.0.1 or 10.0.0, use InstallRįor Mathematica 10.0.1, use InstallR If you installed to a non-standard location or are not using the official distribution, then you’ll need to find where these libraries are and modify the path accordingly. If you installed the official R distribution then the path above is correct. This needs to be done every time before running InstallR and specifying an external installation. Note: Users of OS X 10.11 or later must read this first!įirst, we need to make sure that RLink can find the necessary libraries, and set the DYLD_LIBRARY_PATH environment variable, as follows: SetEnvironment I tested the following with the official R distribution from. On OS X, using external R installations is not officially supported, but it does work in practice with any recent version of R. 1 does support R 3.x so if you have Mathematica 10 please use the 10.0.1 update and the latest version of R. Setupīefore setting up RLink to use an external R installation, make sure it works correctly with default settings, then quit the Mathematica kernel. ![]() ![]() For this reason it is most useful to connect RLink to an external installation of R. Unfortunately by default RLink uses a built-in installation of R (version 2.14, which is quite old) and-except on Windows-it does not allow adding third-party libraries to this installation. Thus it is essential for RLink to be able to use not only built-in R functions but also arbitrary libraries. R is today the standard computer language for advanced statistics and new computational methods are typically first implemented and published as R libraries. Such functionality is usually contained in third-party R libraries. RLink is primarily useful for accessing functionality that is available in R but not Mathematica. OS X 10.11 El Capitan (and later) users, please see this note. MacOS users with R 3.5 and later, please see this note. This is a guide on how to set up RLink with arbitrary R installations on various operating systems and various versions of Mathematica. ![]() RLink is a standard Mathematica package for accessing R functionality from Mathematica. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |