Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix R_HOME problem on Mac OS X
  • Loading branch information
Valentin Georgiev committed Sep 17, 2013
1 parent c18cd5a commit dc2f90b
Showing 1 changed file with 11 additions and 5 deletions.
Expand Up @@ -344,20 +344,26 @@ private String checkUserLibDir() {

// Check if R_HOME is correctly set and tries to correct simple errors.
public String checkR_HOME(String path) throws FileNotFoundException {
Boolean trustRPath = false;
boolean trustRPath = false;
if (OS.startsWith("Mac")) {
if(!rExist(R_HOME + "/R"))
trustRPath = rExist(path + "/R") || rExist(path + "/bin/R");
if(!trustRPath) {
path = "/Library/Frameworks/R.framework/Resources";
trustRPath = rExist(path + "/R");
trustRPath = rExist(path + "/R");
}
if(!trustRPath) {
path = "/opt/local/lib/R";
trustRPath = rExist(path + "/bin/R");
}
} else if (OS.startsWith("Windows")) {
if (R_HOME == null) {
if (path == null) {
path = RegQuery("HKLM\\SOFTWARE\\R-core\\R /v InstallPath");
if (path == null)
path = "";
}
trustRPath = rExist(path + "\\bin\\R.exe");
} else if (OS.startsWith("Linux")) {
if (R_HOME == null) {
if (path == null) {
path = "/usr/lib/R";
}
trustRPath = rExist(path);
Expand Down

0 comments on commit dc2f90b

Please sign in to comment.