cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Benson
Level II

How to Get as Matrix

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
Staff

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
Staff

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}]