如何引用已經開啟的資料表(從多個開啟的資料表)JSL我正在編寫創建不同報告和數據表的腳本。然而,我總是必須最終以區塊方式運行它們,並手動單擊下拉式選單來選擇我想要運行給定腳本區塊的資料表。
我熟悉目前的 data table() 函數,但實際上並不熟悉其他不需要檔案路徑的函數。
有誰知道有什麼簡單的方法來引用或選擇不同的已開啟的資料表(也許是透過名稱或其他方式)?
謝謝!
自動化和腳本編寫回覆:如何引用已開啟的資料表(從多個開啟的資料表)JSL使用 Data Table() 函數可以引用任何資料表。例如:
Data Table("Big Class") << Bivariate( X(:height), Y(:weight) );
人們還可以在創建資料表時設定一個等於資料表的變量,如果該變數在腳本中未更改,它將始終引用它所連結到的表。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << select where( :sex == "F" );
dtFemale = dt << subset( selected columns( 0 ), selected rows( 1 ) );
rpt = New Window( "Subset of big class - Distribution of height, weight",
dtFemale << Distribution(
Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
Continuous Distribution( Column( :weight ), Process Capability( 0 ) )
)
);
Wait( 0 );
dtStats = rpt["Distributions", "height", "Summary Statistics", Table Box( 1 )] <<
Make Combined Data Table;
rpt << Close Window;
dtStats << Tabulate(
Change Item Label( Statistics( Sum, "Stats" ) ),
Remove Column Label( Analysis Columns( Column 2 ) ),
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :Column 2 ) ),
Row Table( Grouping Columns( :Y, :Column 1 ) )
)
);
可以使用其他方法。如果您願意提供您正在使用的程式碼範例,則可能會獲得其他協助。
回覆:如何引用已開啟的資料表(從多個開啟的資料表)JSL如果您仍然想以互動方式選擇在哪個表上執行腳本,但希望它更加健壯,您可以執行以下操作:
names default to here(1);
// Open a couple of tables for demo purposes
dt1 = open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
wait(0);
table_names = {};
For( i = 1, i <= N Table(), i++,
Insert Into( table_names, Data Table( i ) << get name );
);
If( N Items( table_names ) > 0,
tabSelect = New Window( "Select Table For Use",
<<MODAL></MODAL>回覆:如何引用已開啟的資料表(從多個開啟的資料表)JSL謝謝。