刚开始学习 JSL ,使用 JMP16
尝试编写脚本来创建具有选定行的子集数据表,选择标准由列 (7) 中的数值定义。
以下脚本的主干来自“表”选项卡下运行的“子集”。
Data Table( "Subset of 200 kinome all excel" ) <<
Subset(
Linked,
selected rows only(0),
row selection (select where (as column(7) >0.3) );
Selected columns only(0),
);
上述脚本的选择不起作用。 子集表与原始表相同。
我错过了什么?
谢谢
你有几个小问题。
- Selected Rows Only() 需要打开
selected rows only( 1 ),
- 这 ”;”在您的行选择结束时终止了子集。它必须是“,”
row selection( select where( As Column( 7 ) > 0.3 ) ),
这是完整的代码
Data Table( "Subset of 200 kinome all excel" ) << Subset(
Linked,
selected rows only( 1 ),
row selection( select where( As Column( 7 ) > 0.3 ) ),
Selected columns only( 0 ),
);
我根本不会使用这种方法,它在我的计算机上不起作用(仍然是子集中的所有行,并且没有抛出错误/消息):
Names default to here(1);
dt=open("$SAMPLE_DATA\Big Class.jmp");
Data Table( dt ) << Subset(
Linked,
selected rows only( 1 ),
row selection( select where( As Column( 2 ) > 13 ) ),
Selected columns only( 0 ),
);
原因是,在“子集”的文档中我找不到像“行选择”这样的选项,只有
, [number, number, ...])>,
看:子集数据表 (jmp.com)
危险在于,未知参数不会引发错误,因此难以调试。
此外,在该子集语句中选择行时,我真的不能确定选择在子集之前完成,所以它对我来说看起来不稳定。
我的解决方案是选择子集语句之前的行,或者如下通过显式选择行号。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
Data Table( dt ) << Subset(
Linked,
rows( /* explicit rows [1,2,3] or conditionally: */ Loc( (dt:age << get values) > 16 ) ),
Selected columns only( 0 ),
);