Choose Language Hide Translation Bar
Highlighted
uday_guntupalli
Level VIII

Unable to leverage R packages in JSL

All, 

           I had a perfectly working JMP code which was invoking R to access an API. However, I uninstalled R Studio and installed Microsoft Visual Studio Community last night and ever since I am having trouble with my scripts.

As you may see below – I have the httr package installed in R . However, when I call it from JMP, I receive the error shown in 3rd screenshot below.

image.png

 

image.png
image.png

Best
Uday
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Re: Unable to leverage R packages in JSL

First, I would run this from a JMP Script window:

 

R init();

You should see in the log this:

TKIntRJMP.R version  5.05 
0

You can then run a simple  bit of code as well and watch the log to see what happens.  Try this

R Init();
R Submit("\[
	library(boot)

	samplemedian <- function(x, d) {     
	  return(median(x[d]))                
	}

	data <- rnorm(50)                        # Generate a dataset with 50 obs
	b  <-  boot(data, samplemedian, R=2000)  # 2000 bootstrap replications
	plot(b)
]\");

//Return the graphic from the R graphic device to JMP as a picture;
JMP_plot = R Get Graphics(png);
New Window("R Bootstrap Plot", Picture Box(JMP_Plot));

R Term();

Let me know what happens in the log.

 

The issues might be due to the fact that you uninstalled R Studio which may have messed with the registry. You might have to reinstall R.

 

Chris

Chris Kirchberg
Principal Systems Engineer, Life Sciences - JMP Global Technical Enablement
SAS Institute, Inc. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
JMP – A Division of SAS Institute | www.jmp.com

View solution in original post

Highlighted

Re: Unable to leverage R packages in JSL

Uday was working with Support on this issue.

 

He was able to resolve the behavior by rebooting his PC. Seems your suspicions of the registry issues being altered after the removal of R Studio were probably valid. 

View solution in original post

5 REPLIES 5
Highlighted

Re: Unable to leverage R packages in JSL

First, I would run this from a JMP Script window:

 

R init();

You should see in the log this:

TKIntRJMP.R version  5.05 
0

You can then run a simple  bit of code as well and watch the log to see what happens.  Try this

R Init();
R Submit("\[
	library(boot)

	samplemedian <- function(x, d) {     
	  return(median(x[d]))                
	}

	data <- rnorm(50)                        # Generate a dataset with 50 obs
	b  <-  boot(data, samplemedian, R=2000)  # 2000 bootstrap replications
	plot(b)
]\");

//Return the graphic from the R graphic device to JMP as a picture;
JMP_plot = R Get Graphics(png);
New Window("R Bootstrap Plot", Picture Box(JMP_Plot));

R Term();

Let me know what happens in the log.

 

The issues might be due to the fact that you uninstalled R Studio which may have messed with the registry. You might have to reinstall R.

 

Chris

Chris Kirchberg
Principal Systems Engineer, Life Sciences - JMP Global Technical Enablement
SAS Institute, Inc. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
JMP – A Division of SAS Institute | www.jmp.com

View solution in original post

Highlighted
uday_guntupalli
Level VIII

Re: Unable to leverage R packages in JSL

@chris_kirchberg
When I run the following code to initiate the R Connection , here is what I see: 

 

R Init();

image.png

I also ran the rest of the code you shared - and I was able to retreive the plot. 

I will try re-installing R 

 


Warning: Attaching package: 'boot'
Warning: The following object is masked from 'package:lattice':
Warning: melanoma
0

Best
Uday
Highlighted
uday_guntupalli
Level VIII

Re: Unable to leverage R packages in JSL

@chris_kirchberg,
     I uninstalled and re-installed R but I still receive the same error .

Best
Uday
Highlighted

Re: Unable to leverage R packages in JSL

Hmm, that is odd Uday.

 

If the scripts I shared run within JMP then JMP can connect with R and run R code.

 

I am guessing that it must have something to do with Microsoft Visual Studio Community and httr package which was contributed by RStudio.

 

What happens if you uninstall Microsoft Visual Studio Community and try running your code within JMP?

Chris Kirchberg
Principal Systems Engineer, Life Sciences - JMP Global Technical Enablement
SAS Institute, Inc. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
JMP – A Division of SAS Institute | www.jmp.com
Highlighted

Re: Unable to leverage R packages in JSL

Uday was working with Support on this issue.

 

He was able to resolve the behavior by rebooting his PC. Seems your suspicions of the registry issues being altered after the removal of R Studio were probably valid. 

View solution in original post

Article Labels

    There are no labels assigned to this post.