JSL에 대한 초보자 질문JSL을 사용하여 선택한 행을 csv 또는 jmp 파일에 저장하고 싶습니다. 그러나 나는 그것을 할 수 없습니다. 아무도 그것을 끝내는 방법을 알려줄 수 있습니까?
다음 코드로 시도했지만 저장 방법이 잘못된 것 같습니다.
f = Function( {a},
theRows = Current Data Table() << get selected rows;
Show( theRows );
);
rs = Current Data Table() << make row state handler( f );
filepath = "C:\Users\abc\Desktop\trial";
rs << save( filepath || "\" || "part1.jmp" );해석학데이터 테이블스크립팅창Re: JSL에 대한 초보자 질문이를 처리하는 방법에는 여러 가지가 있습니다.이전 토론에서 Partition() 플랫폼과 함께 이 JSL을 사용할 것이라고 가정합니다. 이것이 제가 솔루션에 접근하는 방식입니다.
f = Function( {a},
theRows = Current Data Table() << get selected rows;
Show( theRows );
);
rs = Current Data Table() << make row state handler( f );
filepath = "C:\Users\abc\Desktop\trial";
rs << save( filepath || "\" || "part1.jmp" );Re: JSL에 대한 초보자 질문네, Partition() 플랫폼과 관련이 있습니다. 하지만 데이터를 저장하는 코드를 실행하면 저장할 수 없습니다. 로그에 오류가 표시되지 않으므로 코드가 어디에서 실패하는지 이해할 수 없기 때문에 내 코드를 첨부했습니다.
Re: JSL에 대한 초보자 질문나는 당신이 프로그램 흐름을 볼 필요가 있다고 생각합니다. 행이 정의되기 전에 파일을 저장할 수 없습니다.
이 작은 예는 파티션이 닫힐 때 파티션 플랫폼에서 선택한 행을 테이블에 저장하는 방법을 보여줍니다. 그러나 Jim이 언급했듯이 여러 가지 방법으로!
Names Default To Here( 1 );
// opens partition platform on Big Class data table
// when rows are selected, and platform is closed, selected rows are saved in separate data table
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
obj = Partition( Y( :weight ), X( :sex, :height ), Method( "Decision Tree" ), Validation Portion( .2 ) );
obj << split best();
// When partition window is closed do this:
obj << on close(
If( N Items( dt << get selected rows() ) > 0,
dtTemp = dt << subset( invisible, selected rows( 1 ), selected columns( 0 ) );
filepath = "$TEMP";
Close( dttemp, save( filepath || "\" || "part1.jmp" ) );
// open file again
Open( filepath || "\" || "part1.jmp" );
)
);
Re: JSL에 대한 초보자 질문마지막 응답에서 제공한 JSL에서 실수를 했습니다.그 이후로 답변을 수정했습니다.
이 응답에서는 제공된 JSL을 확장하고 새 선택 행이 지정될 때마다 하위 집합 테이블을 저장하는 완전한 예를 제공했습니다.
행 상태 처리기는 Partition() 창이 닫힐 때도 제거됩니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
tableCount = 0;
theRows = [];
f = Function( {a},
// Set dupRows to the previously selected rows
dupRows = theRows;
// Get the current selected rows
theRows = Current Data Table() << get selected rows;
If( N Rows( theRows ) > 0,
// check to see if there are the same number of rows and if yes
// then validate the rows are different rows before saving
If( N Rows( theRows ) == N Rows( dupRows ),
If( Sum( dupRows == theRows ) != N Rows( theRows ),
tableCount++;
dtTemp = dt << subset( invisible, selected rows( 1 ), selected columns( 0 ) );
filepath = "$TEMP";
Close(
dtTemp,
save( filepath || "\" || "part" || Char( tableCount ) || ".jmp" )
);
Current Data Table( dt );
);
,
// If not the same number of selected rows, save the subset
tableCount++;
Show( tableCount );
dtTemp = dt << subset( invisible, selected rows( 1 ), selected columns( 0 ) );
filepath = "$TEMP";
Close( dtTemp, save( filepath || "\" || "part" || Char( tableCount ) || ".jmp" ) );
Current Data Table( dt );
)
);
);
rs = Current Data Table() << make row state handler( f );
obj = Partition(
Y( :NPN1 ),
X( :PNP1, :PNP2, :PNP3, :PNP4, :NPN2, :NPN3, :NPN4 ),
Method( "Decision Tree" ),
Validation Portion( .2 )
);
obj << ShowGraph( 0 );
obj << SplitBest( 4 );
obj << Show Split Count( 1 );
obj << Show Split Prob( 1 );
Wait( .5 );
//obj << Save Predicteds;
obj << on close( Clear Symbols( rs ) );