변수에 저장된 목록을 Control Chart Builder의 Y 열로 읽는 여러 열 이름으로 정의하고 싶습니다.표제를 실현하는 JSL 스크립트의 작성 방법을 생각하고 있습니다.
사용하는 JMP 버전은 18을 사용합니다.
dt02=current data table();
//列名を変数に
columnNames = dt02 << Get Column Names;
//3列目以降の列はすべてトレンドを確認するために必要
columnNames2={};
For( j = 3, j <= N Items( columnNames ), j++,
Insert Into( columnNames2, Column( columnNames[j] ) );
);
//X-bar_and_S_chart作成
grp01=dt02<<CONTROL chart="" builder=""></CONTROL><LINGO-LABS id="lingo-labs-825157" slang="ja-JP" mode="CREATE"><LINGO-LABEL>자동화 및 스크립팅</LINGO-LABEL><LINGO-LABEL>윈도우</LINGO-LABEL></LINGO-LABS>Re : 변수에 저장된 목록을 Control Chart Builder의 Y 열에로드하는 여러 열 이름으로 정의하고 싶습니다.제어 차트 빌더가 JMP에서 가장 어려운 플랫폼 중 하나가 되고 싶어하는 듯합니다. 이런 식으로 하면 모든 것(어렵고 성가신 것까지)을 작동시킬 수 있어야 합니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cont_cols = dt << Get Column Names("Continuous", String);
ys = Expr(Y());
For Each({colname}, cont_cols,
Insert Into(ys, Name Expr(AsColumn(dt, colname)));
);
Eval(Substitute(
Expr(ccb = dt << Control Chart Builder(
Variables(Subgroup(:age), _ycols_),
Show Control Panel(0),
Chart(Position(1), Limits(Sigma("Standard Deviation"), Spec Limits(1))),
Chart(Position(2), Points(Statistic("Standard Deviation")), Limits(Sigma("Standard Deviation"))),
Show Control Panel(0)
)),
Expr(_ycols_), Name Expr(ys)
));Re : 변수에 저장된 목록을 Control Chart Builder의 Y 열에로드하는 여러 열 이름으로 정의하고 싶습니다.멋진 코드를 주셔서 감사합니다!
문제는 완전히 해결되었으며 감사드립니다.
솔직히 말해, 코드는 아직 잘 이해되지 않습니다.
이미지로서는, ys에 격납한 배열로, 매번 substitute를 실시해, 그 결과를 컨트롤 차트내에 격납하는 것 같은 이미지였다고 생각합니다.
Re : 변수에 저장된 목록을 Control Chart Builder의 Y 열에로드하는 여러 열 이름으로 정의하고 싶습니다.In most of the platforms you could use Eval() with list of columns but in case of control chart builder it doesn't work and you have to have very specific format to make it work Y(:col, :col2). I build the correct format into ys, Y(:height, :weight) and then use Substitute to add to the Control Chart Builder message so it will be "forced" to evaluate correctly. You can see this if you remove Eval() outside of the Substitute() and run that

Show(NameExpr(ys))를 사용하여 ys를 확인할 수도 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cont_cols = dt << Get Column Names("Continuous", String);
ys = Expr(Y());
For Each({colname}, cont_cols,
Insert Into(ys, Name Expr(AsColumn(dt, colname)));
);
Show(Name Expr(ys)); // Name Expr(ys) = Y(:height, :weight);
Re : 변수에 저장된 목록을 Control Chart Builder의 Y 열에로드하는 여러 열 이름으로 정의하고 싶습니다.Eval(Substitute(Expr(...)))
... 또는 Eval(Eval Expr( Expr()...))
팁과 요령 - JMP/JSL을 활용한 모범 사례
Eval (Eval Expr( Expr()...))을 다음과 같이 생각해 보세요.
전체를 Eval() 하기 전에 Expr() 과 Eval Expr() 을 검색해 보세요.
안타깝게도 이 세 가지 단어 모두 E... 로 시작하기 때문에 올바른 의미로 기억하기가 조금 어렵습니다.
4번째 E... 는 Name Expr() 입니다. @jthi가 for 루프에서 문자열을 열로 변환하는 데 사용했습니다(:column) *)
... 그리고 오류 메시지 대신 Y(...) 를 얻어야 합니다 : )
*) Fortunately, Control Chart Builder accepts strings as alternative to columns.
따라서 head를 다음과 같이 바꿔서 열 이름 목록 을 열 이름의 Y() 로 직접 변환할 수 있습니다.
으로 대체하다:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
tmp = dt << Get Column Names("Continuous", String);
Substitute Into(tmp, Expr(List()), Expr(Y()));
Eval(Eval Expr(
ccb = dt << Control Chart Builder(
Variables(Subgroup(:age), Expr(Name Expr(tmp))),
Show Control Panel(0),
Chart(Position(1), Limits(Sigma("Standard Deviation"), Spec Limits(1))),
Chart(Position(2), Points(Statistic("Standard Deviation")), Limits(Sigma("Standard Deviation"))),
Show Control Panel(0)
)
));