cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
rwright
Level III

Find R_HOME on mac

I'm running JMP 13 on Mac Pro. I've searched the discussions for this, but everything talks about setting environmental variables in windows - I've seen nothing about Mac. I have a couple of versions of R installed. In my Rprofile.site I've defined libpaths and libraries. When I bring things up in RStudion and check everythings works fine, including R_home  (this is for R V 3.4.3). From RStudio:

> .Library.site
[1] "/opt/local/Library/Frameworks/R.framework/Resources/site-library"
> .Library
[1] "/opt/local/Library/Frameworks/R.framework/Resources/library"
> .libPaths()
[1] "/Users/rcw/Library/R/3.4/library"
[2] "/opt/local/Library/Frameworks/R.framework/Versions/3.4/Resources/library"
> R.HOME(component='home')
Error in R.HOME(component = "home") : could not find function "R.HOME"
> R.home(component='home')
[1] "/opt/local/Library/Frameworks/R.framework/Resources"

 

When I bring up JMP, however, I get different values:

R Submit(

"

R.home(component='home')

.Library.site

.Library

.libPaths()

"

);

 

[1] "/Library/Frameworks/R.framework/Resources" character(0)

[1] "/Library/Frameworks/R.framework/Resources/library"

[1] "/Users/rcw/Library/R/3.1/library"

[2] "/Library/Frameworks/R.framework/Versions/3.1/Resources/library"

 

Is there a .profile that JMP reads where I can set the appropriate environmental variables (it doesn't look like it reads my .profile) 

 

Thanks for any insight into this.

RCW

2 REPLIES 2
julian
Community Manager Community Manager

Re: Find R_HOME on mac

Hi @rwright,

What is returned in your jmp log when you get the R_HOME environment variable via jsl? (Note that on the mac environment variables are case sensitive):

 

Get Environment Variable( "R_HOME" );

 

For me, this returns:  "/Library/Frameworks/R.framework/Versions/Current/Resources"

 

If you aren't getting what you expect, or you want to point jmp to a specific version, you can set the variable in a similar way. For me, I'd run: 

 

Set Environment Variable( "R_HOME", "/Library/Frameworks/R.framework/Versions/Current/Resources" );

I hope this helps point you in the right direction!

@julian

 

rwright
Level III

Re: Find R_HOME on mac

Julian:

 

Thanks, for the reply, and you made a point, I guess I had somewhat overlooked.

 

When I run Get Environment Variable("R_HOME");, I get the same as you : "/Library/Frameworks/R.framework/Versions/Current/Resources"

 

I guess the point, the question, I was trying to get to was, given that we both get have the same R_HOME in JMP, why am I getting different version when I run the same code under differing R scenarios? I know where the differences come from - the R_HOME under RStudio comes from the Macports distributions I use (and update). I'm guessing the other version comes from an old CRAN distribution I got "way back when ...". What I would like, what I thought I was getting, was to set something behind the scenes - hence the Rprofile.site, which is one of the files looked for at R initialization (CRAN, Initialization at start of R Session). 

 

I guess the broader question, I'm asking is how do the Mac versions of JMP inherit their environments. Under Windows, they look into the registry, I guess in addition to whatever variables get set up in config files. The mac analogue, I guess would be looking at plist, and / or something like .profile or .bash-profile, etc. So what are the plists, or profile? And the followup question is, of course, how are these passed to, if they are passed to, say R, or are they?

 

Thanks,

Richard Wright (i'm sure there's a way to set this, just don't know what it is ...)