함수에 인수로 열 이름을 전달할 때 :를 사용하여 연결해야 합니까?아래는 분포를 그리기 위해 열 이름을 전달하려고 하는 함수인데 작동하지 않습니다. 올바른 구문이 무엇인지 궁금합니다.
Names Default To Here (1);
getDistChart = Function({ColName}, {dC},
dC = Distribution( Continuous Distribution( Column( :ColName) ) );
return(dC);
);
//gt = getDistChart ("MyCol"); to test the function
나는 이미 MyCol을 열 이름으로 하는 데이터 테이블을 열었습니다. 연결해야 할지 궁금합니다.
:
열 이름을 사용하여
ColName
그렇다면 어떻게 해야 하나요?(일반적인 || || 연결은 작동하지 않는 듯합니다)
데이터 접근데이터 블렌딩 및 정리데이터 탐색 및 시각화실험 설계대량 맞춤형Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?@Mark_Bailey에게 감사드립니다. 작동합니다.
Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?예, JMP Pro 16.1.0에서는 완벽하게 작동합니다. 테스트할 이전 버전의 JMP가 설치되어 있지 않습니다. 귀하의 버전은 약 5년 전입니다. JSL은 지속적으로 발전하고 있으므로 내 구문이 이전 버전에서는 작동하지 않을 수도 있습니다.
도움이 필요하면 JMP 기술 지원( support@jmp.com )에 문의하세요.
원하는 것을 달성하기 위해 표현식을 사용해 볼 수도 있습니다. 버전 4 이후 모든 버전의 JMP에서 작동합니다. 이 버전이 작동하는지 확인하세요.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
getDistChart = Function( {ColName, _LSL, _USL}, {distChart},
Eval(
Substitute(
Expr(
distChart = New Window( "" || ColName || " distribution",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( As Column( ColName ) ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis( LSL( _LSL ), USL( _USL ) )
),
SendToReport(
Dispatch(
{ ccc },
"Distrib Histogram",
FrameBox,
{DispatchSeg( LabelSeg( 1 ), {Font( "Segoe UI", 7, "Plain" )} ),
DispatchSeg( LabelSeg( 2 ), {Font( "Segoe UI", 7, "Plain" )} )}
)
)
)
);
),
Expr( ccc ), colName
)
);
Return( distChart );
);
getDistChart( "weight", 55, 185 );Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?@Mark_Bailey 감사합니다. 스크립트를 실행하면 로그에 다음이 표시됩니다.
Cannot find item "ColName" in outline context {ColName}
당신에게 효과가 있나요?
(저는 JMP 13을 사용하고 있습니다)
Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
getDistChart = Function( {ColName, _LSL, _USL},
{distChart},
New Window( "" || ColName || " distribution",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( As Column( ColName ) ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis( LSL( _LSL ), USL( _USL ) )
),
SendToReport(
Dispatch(
{colName},
"Distrib Histogram",
FrameBox,
{DispatchSeg( LabelSeg( 1 ), {Font( "Segoe UI", 7, "Plain" )} ),
DispatchSeg( LabelSeg( 2 ), {Font( "Segoe UI", 7, "Plain" )} )}
)
)
)
);
Return( distChart );
);
getDistChart( "weight", 55, 185 );Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?@Mark_Bailey 감사합니다. 작동합니다. 그런데 다음 단계로 넘어가는데 막히네요. 내 스크립트의 여러 위치에 열 이름을 전달하고 싶습니다. 아래의 예로 Big Class를 사용합니다. ColName을 새 창에는 전달할 수 있지만 Dispatch에는 전달할 수 없습니다.
Names Default To Here (1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
getDistChart = Function({ColName, _LSL, _USL}, {distChart},
New Window(""||ColName||" distribution",
Distribution(
Stack( 1 ),
Continuous Distribution(
Column(As Column (ColName) ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Capability Analysis( LSL(_LSL ), USL(_USL) )
),
SendToReport(
Dispatch(
{"weight"},
"Distrib Histogram",
FrameBox,
{DispatchSeg( LabelSeg( 1 ), {Font( "Segoe UI", 7, "Plain" )} ),
DispatchSeg( LabelSeg( 2 ), {Font( "Segoe UI", 7, "Plain" )} )}
)
)
);
);
return(distChart);
);
getDistChart ("weight", 55, 185);
예를 들어 이
Dispatch( {ColName},...
아니면 여기서부터
Dispatch( {Expr(ColName)},...
작동하지 않습니다. Dispatch의 인수로 문자열을 전달하는 올바른 구문은 무엇입니까?
Re: 열 이름을 함수에 인수로 전달하는 중 - 다음과 연결됩니다: 필요합니까?Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
getDistChart = Function( {ColName}, {dC},
dC = Distribution( Continuous Distribution( Column( As Column( colName ) ) ) );
Return( dC );
);
gt = getDistChart ("weight");