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
Adhil71186
Level I

Issues in running a R Script from JSL

This is my script:

 

Names Default To Here( 1 );
R Init();
x = R Submit File("C:/Users/adhil/Documents/JMP/Test Program Validation/Jun 2021 Test Program Release Validation/compile.r");
df = R Get(main_df)
R Term();

 this is the R Script I intend to run

 

library(dplyr)

setwd("~/JMP/HPLED Validation/Jun 2021 HPLED Release Validation")

new_tProgram_data <- "./data/A05/data_01.blu"
por_tProgram_data <- "./data/A05/data_02.blu"

new_df <- read.table(new_tProgram_data , sep="\t", skip=2, header=T) %>%
  select(c("Row", "Col", "Voltage", "LeakageV", "Power"))
colnames(new_df) <- paste(colnames(new_df), "NEW", sep = "_")

por_df <- read.table(por_tProgram_data , sep="\t", skip=2, header=T) %>%
  select(c("Row", "Col", "Voltage", "LeakageV", "Power"))
colnames(por_df) <- paste(colnames(por_df), "POR", sep = "_")

main_df <- merge(new_df, por_df, by.x=c("Row_NEW", "Col_NEW"), by.y=c("Row_POR", "Col_POR"))

However when I run the R script from JSL and try to retrieve the main_df from r via

df = R Get(main_df)

I get the following Error

Capture.PNG

x = R Submit File("C:/Users/adhil/Documents/JMP/Test Program Validation/Jun 2021 Test Program Release Validation/compile.r");

x shows -1

 

please advise

3 REPLIES 3

Re: Issues in running a R Script from JSL

Hi,

 

You may have already tried this, but if not: try running the code (as you only have a few lines) line-by line using R Submit ( ) statements interspersed with R Get statements... you should then be able to see whether the problem is the original data (beginning with the files xxx.blu themselves), the merge itself (perhaps empty), or something else.

 

Cheers,

Brady

Adhil71186
Level I

Re: Issues in running a R Script from JSL

Hi brady

I ran the the code in r studio, with the same blu files and it works. I haven't run line by line though
Adhil71186
Level I

Re: Issues in running a R Script from JSL

When I type print(main_df) in the rscript , the data frame gets printed out in jmp logs, I have a problem in importing it to jmp