概述
以下示例演示了如何在数据表中选择包含存储在 JSL 列表中的任何值的行。可以使用包含数字或字符串的列表。
指示
在 JMP® 会话中,单击文件菜单并选择新建 ► 脚本。复制以下脚本并将其粘贴到脚本窗口中。要运行示例脚本,请单击编辑菜单并选择运行脚本。
/* Open a sample data table. */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Create a list of ages. */
myList = {9, 12, 15, 17, 18};
/* Select all rows which have an age that is in the list. */
dt << Select Where( Contains( myList, :age ) );
Wait( 2 ); // For demonstration purposes
dt << Clear Select; // For demonstration purposes
/* Create a list of student names. */
myStudents = {"HENRY", "ROBERT", "BARBARA", "SALLY", "MARION"};
/* Select all rows which have any of the names in the list. */
dt << Select Where( Contains( myStudents, :name ) );
其他文档
有关 JMP 脚本语言的更多信息,请参阅JMP 脚本指南您可以在 JMP 中点击帮助菜单并选择JMP 帮助。从在线目录中选择脚本指南.
[先前的 JMP 说明 49560]
@Wendy_Murphrey ,您能否通过在哪里()发布一个新方法的相应示例