やあ、
このJSLスクリプトは問題なく実行され(Windows 10 Pro 64ビットでJMP 16.0.0(512257)を使用しています)、期待されるpng出力を生成しますggplot 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;まったく同じ R コードを使用して R スクリプトを直接呼び出そうとすると、「''png のデータの取得に失敗しました」というエラー メッセージが表示されて失敗します。
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;
この簡略化された JSL スクリプトは、私の最初の試みであり、同じエラー コードで失敗します。
R Init();
R Submit File( "C:\Users\xxx\R_projects\JMP\R_JPM_integration_1.R" );
R Get Graphics( png );
R Term();
このテストに使用する単純な R スクリプトは次のとおりです。
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)
これは、最初のスクリプトの R コードと同じです。
R Submit File 呼び出しに問題はありますか? 私は何が欠けていますか?
私は使用することを好むR 提出ファイルタイピングの手間が省けるからです。