JMP 18 Python Integration using R through PythonI have a customer interested in this topic and have been working on some examples of running R through the new Python integration.
With JMP 18, there are 4 methods that I aware of:
- The old R integration using JSL to interact with R. This currently still works with JMP 18 but I believe will be deprecated in JMP 19. There is an attached example called R_Bootstrap_Sample (old integration).jsl.
- The new Python integration using Rscript. There is an attached example called R_Bootstrap_Sample.py which is a version of the Bootstrap script (bootstraps the median statistic of some randomly generated data). This example uses R-code which is stored in an external file (also attached). To get this to work, I had to add a path definition to the folder containing Rscript. To get this script to run, you might have to customize this path to match your situation, line 25 in the script.
- The new Python integration using Rserve. This might be the preferred method for many customers. Unfortunately, I'm having difficulty getting a working example. I believe my issue is Windows is refusing the connection to Rserve. When I get a working example, I'll update this post.
- The new Python integration using rpy2. rpy2 uses an embedded version of R. There is a sample script from Sam in the training starter. This has an environmental variable for R_HOME that needs to be customized to match your situation, line 15 in the script.
There are also some features that would be nice to add to the sample scripts:
- Taking an R dataframe, sending it to Python, then converting it to a JMP table.
- Sending an R graphical object, sending it to Python and displaying it in a JMP display window. The example using the old integration method uses R Get Graphics() to transfer an R generated plot to JMP.