你好。 有谁知道如何控制打开时“.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,您可以先搜索它,然后再使用参考。