我嘗試手動點擊列管理器和製作成數據表選項,腳本儲存如下。當我複製並運行腳本時,遇到了附件中的錯誤。如何使用 JSL 腳本從列管理器產生資料表?
Names Default To Here( 1 );
Assign( rpt );
Wait( 0 );
rpt["Columns Manager", Table Box( 1 )] << Make Into Data Table;
rpt << Close Window;
這是我編寫的腳本,用於從列管理器建立資料表
Names Default To Here( 1 );
dt=current data table();
main menu("columns manager");
rpt = window(dt << get name || " - Columns Manager");
Wait( 0 );
rpt["Columns Manager", Table Box( 1 )] << Make Combined Data Table;
rpt << Close Window;
列管理器似乎傳回了一個有點奇怪的引用,你需要做一些額外的操作才能取得資料表( @朱利安不確定這個問題在 JMP19 中是否已經修復)。這裡還有一個選項
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cm = dt << Columns Manager(
Hide Hidden Columns(0),
Hide Excluded Columns(0),
Include Extended Statistics(1),
Force calculations for all numeric columns(1),
Force calculations for all categorical columns(1)
);
wait(0);
(cm << top parent)[TableBox(1)] << Make into Data Table();
我不確定 wait(0) 對於列管理器是否總是足夠,因為我認為它可以動態計算統計資料。如果你有列組,你必須先展開它們。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Probe.jmp");
dt << Expand All Column Groups;
cm = dt << Columns Manager(
Hide Hidden Columns(0),
Hide Excluded Columns(0),
Include Extended Statistics(1),
Force calculations for all numeric columns(1),
Force calculations for all categorical columns(1)
);
wait(0);
(cm << top parent)[TableBox(1)] << Make into Data Table();
您是否嘗試過資料字典是否足以滿足您的用例?
