Publication date: 07/15/2025

Install jmpex

There are two ways to install the jmpex package. The first is to call R Init() or R Connect() in JMP 19. Doing either triggers the automatic installation of jmpex using jpip().

Note that jmpex has package requirements. If those requirements, or the requirements for other packages such as rpy2, numpy, and pandas, are not found on the system, they will be downloaded and installed (assuming that Internet access is allowed and that permissions do not restrict Python package installation).

If you are prompted to install additional developer tools to install the required packages, you must agree for the jmpex installation to complete. You might need to restart JMP for the R connections to be fully functional.

The second way to install the jmpex package is by explicitly using jpip(). The package is located at $SAMPLE_SCRIPTS/Python/jmpex.zip.

From a JMP Python script window, run the following:

import jmp
import os
from jmputils import jpip
jpip(‘install’, [ os.path.join(jmp.SAMPLE_SCRIPTS,‘Python’,‘jmpex.zip’) ] )
import jmpex
help( jmpex )

The brackets [ ] in the jpip command are needed to ensure that the path is treated as a single string because the default path for JMP on both macOS and Windows contains a space.

Import jmpex and Test Your Setup

The jmpex import package contains the module R and class R. Using the jmpex package for Python, R, and JSL scripts ensures a consistent approach across all languages.

To use jmpex, you must create and initialize an instance of jmpex in Python code. Optionally, the name for an R backend can be passed in as the initialization parameter. At present only rpy2 is accepted. The following Python code imports the jmpex.R.R class, initializes an R instance in variable jr, and calls is_connected() and r_version():

import jmp
from jmpex.R import R
jr = R()
print(f'\nR initialized: {R.is_connected()}')
print(f'\nR Version: {jr.r_version()}')
 

To test that your computer is able to run JSL-based scripts that use R, run the following JSL script:

R Init( );
R Submit( "
	x <- 1:5
	x
" );
R Term( );

You should see the following output in the log:

[1] 1 2 3 4 5

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).