I have this script as seen below where I calculate some simple in R, and where I want to see some plots in JSL. I cannot get JSL to show the two plots. When I run the code below it close plot1 and only show plot two. I have tried using what is descirbed here ( https://community.jmp.com/t5/JMPer-Cable/Getting-started-with-the-JMP-to-R-Interface/ba-p/43920 ) but I cannot get it to work. It might be a simple command but I am pretty new to JSL. I hope you can help. FYI I use JMP 17.2
Names Default To Here(1);
Include("Dialog_script.jsl"); // Load the dialog to get selected X and Y columns
dt = Current Data Table(); // Get the current data table
// Get the selected X and Y columns from the data table
xCol = Column(dt, xColName[1]);
yCol = Column(dt, yColName[1]);
// Check if columns exist
If(xCol == Empty() | yCol == Empty(),
Throw("Error: The selected columns do not exist in the data table.");
);
// Extract the values from xCol and yCol
xValues = xCol << Get Values; // Get the values of xCol
yValues = yCol << Get Values; // Get the values of yCol
// Show the values being sent to R (for debugging)
Show(xValues);
Show(yValues);
// Initialize the R connection
R Init();
// Send the values of xCol and yCol to R as numeric vectors
R Send( xValues );
R Send( yValues );
// Execute the external R script
R Submit File( "C:/Users/NDS/Data_Ana.R" );
// Retrieve the plot
R submit( "print(plot1)" );
R submit( "print(plot2)" );
// Terminate the R connection
//R Term();