Salut,
Ce script JSL s'exécute sans aucun problème (j'utilise JMP 16.0.0 (512257) sous Windows 10 Pro 64 bits) et génère la sortie png attendue à partir de ggplot dans JMP :
LoadExprs = Expr(
InitR = Expr(
R Init();
R Submit( "
library(dplyr)
library(ggplot2)
library(palmerpenguins)
" );
);
MakePlot = Expr(
R Submit(
Eval Insert(
"\[
ggplot(data = penguins, aes(x = bill_length_mm, y = flipper_length_mm, colour = species)) +
geom_point() +
facet_wrap(. ~ island, nrow = 3)
]\
"
);
);
);
CapturePlot = Expr(
JMP_plot = R Get Graphics( png );
New Window( "Imported Plot", Picture Box( JMP_Plot ) );
);
RunClose = Expr(
R Term(); //Close r connection
);
);
LoadExprs;
InitR;
MakePlot;
CapturePlot;
RunClose;Si j'essaie d'appeler le script R directement, avec exactement le même code R, il échoue avec le message d'erreur "Echec de l'obtention des données pour ''png''".
Voici le script JSL :
LoadExprs = Expr(
InitR = Expr(
R Init();
);
RunR = Expr(
R Submit File( "C:\Users\xxx\R_projects\JMP\R_JPM_integration_1.R" );
);
CapturePlot = Expr(
JMP_plot = R Get Graphics( png );
New Window( "Imported Plot", Picture Box( JMP_Plot ) );
);
RunClose = Expr(
R Term(); //Close r connection
);
);
LoadExprs;
InitR;
RunR;
CapturePlot;
RunClose;
Ce script JSL simplifié, ma première tentative, échoue également avec le même code d'erreur :
R Init();
R Submit File( "C:\Users\xxx\R_projects\JMP\R_JPM_integration_1.R" );
R Get Graphics( png );
R Term();
Et voici le simple R-script que j'utilise pour ce test :
library(dplyr)
library(ggplot2)
library(palmerpenguins)
ggplot(data = penguins, aes(x = bill_length_mm, y = flipper_length_mm, colour = species)) +
geom_point() +
facet_wrap(. ~ island, nrow = 3)
Qui est identique au code R du premier script.
Y a-t-il un problème avec l'appel R Submit File ? Qu'est-ce que je rate?
je préférerais utiliser R Soumettre le fichier car cela évite le travail de frappe.