cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Choose Language Hide Translation Bar
drewb
Level I

JMP find R

Hi there,

Very much a novice-question here. I like to use JMP, and have some data in R that I'd like to import to JMP. I'm trying to use the JMP-to-R interface (first time scripting in JMP), and I don't really know what I'm doing. However, when I run the following JSL script, nothing happens;

 

test1 = Get R(test1);

I'm sure there's much more to it than this, but I'm really at a loss on how to proceed. If you have some suggestions for how I begin pulling data from R into JMP, I'd love to hear! I'm on a PC that just got upgraded to Windows 10, so something I was thinking (but have no idea if this is it) is that JMP can't find the location of my R installation. Again, this is my first venture into JSL scripting, so this is probably a beginner question, but I'm not really sure what I'm doing here. Thanks!

14 REPLIES 14
drewb
Level I

Re: JMP find R

Hmm, maybe what I was wanting to do won't work in this instance?

I had a data.frame that was already in the R Global Environment (I/other people had worked on it in R), and I wanted to pull it into JMP. However, from my understanding of our conversation, I would need to run the entire R script in the JMP Script dialog box in order for JMP to "see" the data.frame. Is this correct?

 

Or maybe there's another step I've missed here. If I've already created a data.frame in R (and it is now in the R 'Global Environment), it's still not visible to JMP. But can it become visible to JMP? In R, I've run the following command:

test1 <- data.frame("x"=c(1,2,3,4),"y"=c(5,6,7,8))

So now "test1" is in the R Global Environment. But for some reason JMP still can't "see" it? Maybe there's something I can do to make this data.frame visible to JMP without having to rerun the R script through the JMP Script dialog box?

Re: JMP find R

I just tried using a connection but it did not fare any better.

 

I have never encountered this situation before. I have always sent what I need to R, run R scripts, returned what I want, and move on in JMP. 

 

I am not convinced that it is not possible. I recomment that you contact JMP Technical Support (support@jmp.com) and ask them for help.

drewb
Level I

Re: JMP find R

Thanks for trying this out on your end, Mark! I'll reach out to Technical Support to see what they have to say on this. 

Re: JMP find R

Please post their answer here. New territory!

drewb
Level I

Re: JMP find R

I spoke to JMP Support about this topic; unfortunately, a user isn't able to pull a dataframe from R into JMP the way I was enquiring. From JMP Support:

 

 

JMP does not interact with R in this manner. When JMP initializes R, it starts a new session (environment). That session is completely isolated from R meaning, if you were to start a new R session, JMP would not recognize any of the environment variables (global or local). This is why your R data frame is unknown to JMP.

There are a few ways to pull data from R into JMP, but they essentially all require that the dataframe in R is "created" by running a script through the JMP Scripting dialog box. I've been doing option #3 (having R write the dataframe to a csv file, and then opening the csv file with JMP), but option #2 is intriguing. When I tried, this, unfortunately, I ran out of memory on my computer, so this may not be a viable option for extremely large dataframes. These were the suggestions from JMP Support:

 

1.	Use JMP's R Submit () to create the data frame. The use R Submit () and R Get () to bring the data frame into JMP. This is probably the mostly commonly used approach. 
 
2.	Use JMP's R Submit () to load the data frame via R and bring it back to JMP.
 
3.	Lastly, you can also save the data frame from R as a CSV and open it in JMP using JSL's open function.