Transpose
Example 1
Summary: Generates and visualizes the missing data pattern for a specified set of columns in a JMP data table, utilizing the Transpose function to reorganize the data.
Code:
// Transpose by
// Open data table
dt = Open("data_table.jmp");
// Transpose by
Current Data Table() <<
Transpose(
columns( :subject, :miles ),
By( :species ),
Label( :season )
);
Code Explanation:
- Open table.
- Transpose data.
Example 2
Summary: Generates and visualizes the missing data pattern for a specified set of columns in a JMP data table, utilizing the Transpose function with label.
Code:
// Transpose with label
// Open data table
dt = Open("data_table.jmp");
// Transpose with label
Current Data Table() <<
Transpose(
Columns( :plastic, :tin, :gold ),
Label( :item )
);
Code Explanation:
- Open table.
- Transpose columns.
- Use item as label.
Transpose using Data Table
Summary: Runs the transformation and labeling of a data table, creating new columns for height squared and weight squared, while also performing a by-sex transformation and extracting first names.
Code:
Open("data_table.jmp");
Data Table("data_table") << Transpose(
columns( Transform Column( "height^2", Formula( :height * :height ) ), Transform Column( "weight^2", Formula( :weight * :weight ) ) ),
By( Transform Column( "Last[sex]", Character, Formula( Word( -1, :sex ) ) ) ),
Label( Transform Column( "First[name] 2", Character, Formula( Word( 1, :name ) ) ) ),
Label column name( "name" ),
Output Table( "Transpose of data_table" )
);
Code Explanation:
- Open data table.
- Transpose data table.
- Create height squared column.
- Create weight squared column.
- By sex transformation.
- Extract first name.
- Label columns.
- Name label column.
- Output transposed table.
- Save as "Transpose of data_table".