你好。 有誰知道如何控制打開時“.jmp”擴展名是否出現在表名的末尾?
我注意到當我打開一些桌子時它在那裡,但在其他桌子上,沒有。 我不知道為什麼。 我正在編寫一個使用表名的腳本,我需要它保持一致。 是否有我可以用來控制它的首選項或某些命令? 如果找到,我曾考慮從所有表中任意剝離 .jmp,但這不是我的首選。
JMP 專業版 15.2.1
Mac OS 大蘇爾 11.6
你好@nikles ,
這不會直接回答您的問題,但我建議避免按名稱引用表格。我看到的最常見的問題是有人已經用您感興趣的名字打開了一個表,或者未來對您的腳本的更改會產生意想不到的後果。相反,您可以保存對該表的引用並在腳本的其餘部分中使用它。如果您指望已經打開特定表的用戶,您可以搜索它。 這裡有些例子:
Names default to here(1);
dt1 = Open( "$Sample_data/iris.jmp" );
dt1 << Set Name("iris2");
dt1 = Open( "$Sample_data/iris.jmp" );
dt2 = Open( "$Sample_data/big class.jmp" );
//Get first matching table
dt3 = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"))[1]
//or ask the user which one to use
TableList = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"));
winSelectTable = New Window("Which Table?", << Modal, << Return Result,
lbTable = List Box(TableList)
);
dt3 = filter each({dt}, Get data table list(), (dt << get Name) == winSelectTable["lbTable"][1])[1];
//Now always refer to that table using the table reference
dt3 << Distribution( Continuous Distribution( Column( :Sepal length ) ) );
//If making new tables in your script, you can usually get those references
//from the functions that create them:
dt4 = (dt3 << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :Sepal length ) ),
Row Table( Grouping Columns( :Species ) )
)
)) << Make Into Data Table;
dt4 << Get Name()'
n,您可以先搜索它,然後再使用參考。