Columns
Text to Columns
Example 1
Summary: Runs the conversion of a Model column to text columns and creates indicator columns, while linking the resulting data table to another reference table.
Code:
dt2 = Open( "data_table.jmp", invisible );
dt2 << Text to Columns( Delimiter( " " ), Make Indicator Columns( 0 ), Columns( :Model ) );
dt2:Model2 << Set Property( "Link Reference", Reference Table( "data_table2.jmp" ) );
Code Explanation:
- Open data table;
- Convert Model column to text columns.
- Create indicator columns for Model.
- Link Model2 to Cars 1993.jmp.
Example 2
Summary: Prepares data by opening a data table, converting the Model column to columns, creating indicator columns, and linking the Model2 column to the Cars 1993 reference table.
Code:
dt2 = Open("data_table.jmp");
dt2 << Text to Columns( Delimiter( " " ), Make Indicator Columns( 0 ), Columns( :Model ) );
dt2:Model2 << Set Property( "Link Reference", Reference Table( "$SAMPLE_DATA/Cars 1993.jmp" ) );
Code Explanation:
- Open data_table data
- Convert Model to columns.
- Create indicator columns.
- Link Model2 to Cars 1993.
Group Columns
Example 1
Summary: Runs data table operations by opening a file, grouping and ungrouping columns, and retrieving column names.
Code:
dt = Open("data_table.jmp");
cols = {:age, :sex, :height, :weight};
dt << Group Columns( cols );
dt << Ungroup Columns( cols );
n = dt << Get Column Names;
Code Explanation:
- Open data table.
- Define column list.
- Group specified columns.
- Ungroup specified columns.
- Retrieve column names.
Example 2
Summary: Runs the renaming process for column groups in a data table, demonstrating the iterative application of rename operations.
Code:
dt = Open("data_table.jmp");
gname1 = dt << Group Columns( {height, weight} );
gname2 = dt << Rename Column Group( gName1, "Size" );
gname3 = dt << Rename Column Group( gName2, "Dimensions" );
gname4 = dt << Rename Column Group( gName3, "Dimensions" );
Code Explanation:
- Open data table.
- Group columns height and weight.
- Rename column group to Size.
- Rename column group to Dimensions.
- Attempt to rename column group again.
Example 1
Summary: Opens a data table and selecting specific columns for analysis.
Code:
dt1 = Open( "$SAMPLE_DATA/data_table.jmp", select columns( "age", "height", "weight" ) );
Code Explanation:
- Open data table.
- Select specific columns.
Example 2
Summary: Opens a JMP data table, ignoring specific columns and assigning it to a variable dt2.
Code:
dt2 = Open( "$SAMPLE_DATA/data_table.jmp", ignore columns( "name", "sex" ) );
Code Explanation:
- Open data table;
- Ignore "name" column.
- Ignore "sex" column.
- Assign to dt2 variable.
Example 3
Summary: Opens a data table, selecting specific columns, and retrieving column names for further analysis.
Code:
dt1 = Open( "$SAMPLE_DATA/data_table.jmp", select columns( "weight", "age" ) );
collist = dt1 << get columnnames( string );
Code Explanation:
- Open data table;
- Select specific columns.
- Assign table reference.
- Retrieve column names.
- Store column names in list.
Example 4
Summary: Opens a JMP data table, hiding the table window, ignoring specified columns, and retrieving column names for storage in a list.
Code:
dt1 = Open( "$SAMPLE_DATA/data_table.jmp", invisible, ignore columns( "name", "sex" ) );
collist = dt1 << get columnnames( string );
Code Explanation:
- Open data table.
- Hide table window.
- Ignore specified columns.
- Retrieve column names.
- Store column names in list.
Select Columns
Example 1
Summary: Selects and retrieves specific columns from a data table, including clearing previous selections.
Code:
dt = Open("data_table.jmp");
dt << Select Columns( :Height );
names = dt << get selected columns;
dt << Clear column selection;
clist = {:Height, :Weight};
dt << Select Columns( clist );
name2 = dt << get selected columns;
Code Explanation:
- Open data table;
- Select "Height" column.
- Get selected column names.
- Clear column selection.
- Define column list.
- Select specified columns.
- Get selected column names again.
Example 2
Summary: Process of opening a data table, selecting all columns, and retrieving selected column names.
Code:
dt = Open("data_table.jmp");
dt << Select Columns( all );
colnames = dt << Get selected Columns;
Code Explanation:
- Open data table;
- Select all columns.
- Retrieve selected column names.
Example 3
Summary: Opens a data table and selecting the 'age' column, providing an interactive platform for further analysis.
Code:
dt2 = Open( "$SAMPLE_DATA\data_table.jmp", Select Columns( "age" ) );
Code Explanation:
- Open data table;
- Select "age" column.
Move selected columns
Summary: Process of moving specific columns to the end of a data table, utilizing the Move selected columns() function.
Code:
dt2 = Open("data_table.jmp");
list2 = {"State", "Region"};
dt2 << Move selected columns( list2, To last );
Code Explanation:
- Open data table.
- Define column list.
- Move columns to end.
Columns
Summary: Opens a JMP data table, ignoring a specific column.
Code:
dt3 = Open( "$SAMPLE_DATA\data_table.jmp", ignore Columns( "年齢" ) );
Code Explanation:
- Open data table.
- Ignore specific column.