cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

How to Get as Matrix

Benson
Level II

I am wondering if anyone knew how to get as matrix with specific row.

 

For example, I would like to get as matrix with row(1),

mat will be [12 59 95].

Names Default To Here( 1 );bigclass=Open( "$SAMPLE_DATA/Big Class.jmp" );mat = bigclass << GetAsMatrix({2,3::5});Show(mat);

mat =
[ 12 59 95,
 12 61 123,
 12 55 74,
 12 66 145,
 12 52 64,
 12 60 84,
 12 61 128,
 12 51 79,
 13 60 112,
 13 61 107,
 13 56 67,
 13 65 98,
 13 63 105,
 13 58 95,
 13 59 79,
 14 61 81,
 14 62 91,
 14 65 142,
 14 63 84,
 14 62 85,
 14 63 93,
 14 64 99,
 14 65 119,
 14 64 92,
 14 68 112,
 14 64 99,
 14 69 113,
 15 62 92,
 15 64 112,
 15 67 128,
 15 65 111,
 15 66 105,
 15 62 104,
 15 66 106,
 16 65 112,
 16 60 115,
 16 68 128,
 17 62 116,
 17 68 134,
 17 70 172];

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User


Re: How to Get as Matrix

Here is one way to do this:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << delete columns( {name, sex} );
valueMatrix = dt[1, 0];

Show( valueMatrix );
Jim

View solution in original post

ian_jmp
Level X


Re: How to Get as Matrix

Depending on what else you are doing, you could also use data table subscripting:

mat2 = bigclass[1, {2, 4, 5}]

View solution in original post

2 REPLIES 2
txnelson
Super User


Re: How to Get as Matrix

Here is one way to do this:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << delete columns( {name, sex} );
valueMatrix = dt[1, 0];

Show( valueMatrix );
Jim
ian_jmp
Level X


Re: How to Get as Matrix

Depending on what else you are doing, you could also use data table subscripting:

mat2 = bigclass[1, {2, 4, 5}]