我想在 jmp 文件中保存表中的選定行,並在使用分區函數後將選定行的反轉保存在另一個 jmp 文件中。 我瀏覽了一些示例和其他線程,但我無法保存選定的行和倒置的行。 我一定做錯了什麼。 有誰知道如何在 JSL 中完成它?
Names Default To Here( 1 );
dt = Open( "C:/Users/Desktop/driver/MASTER.jmp" );
f = Function({a}, theRows = Current Data Table() << get selected rows;
Show(theRows);
);
obj = Partition(
Y( :Failed ),
X(
:VOLUME,
:FAMILY,
:CONFIG
),
Method( "Decision Tree" ),
Validation Portion( .2 )
);
obj << ShowGraph( 0 );
obj << SplitBest( 4 );
obj << on close( Clear Symbols( rs ) );
action = 0;
actionsubset = 0;
look_window = New Window( "Decision",
Lineup Box( N Col( 1 ),
V List Box(
Text Box( "After selection of the rows,go for Plot?" ),
H List Box(
spacer box(size(100,5)),
Button Box( "Continue",
action = 1;
look_window << close window;
//obj << Save( "C:\Users\Desktop\test.csv" );
//filepath = "C:\Users\Desktop\driver";
//rs << save( filepath || "\" || "p1.jmp" );
Include("C:/Users/Desktop/driver/plot.jsl");
),
Button Box( "Close",
action = 2;
Close( obj, nosave );
//Throw( "You cancelled the script." );
),
)
),
)
);我可以看到的第一項是,您將變量“obj”設置為指向分區平台的輸出報告的指針,然後在新窗口中,您正在使用“obj”,就好像它是指向你的數據表。指向數據表的指針是打開表時創建的變量“dt”。
下面是一個簡單的示例,顯示了一種從選定行創建數據表的簡單方法,然後從該選擇的逆向創建另一個數據表
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << select where( :sex == "F" );
dtF = dt << subset( selected rows( 1 ), selected columns( 0 ) );
dt << invert row selection;
dtM = dt << subset( selected rows( 1 ), selected columns( 0 ) );
close( dt, nosave );