cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • We’re improving the Learn JMP page, and want your feedback! Take the survey
Choose Language Hide Translation Bar
SDF1
Super User

JSL: How to set a single row across multiple columns to a single value?

Hello JSL specialist,

 

  Wondering if there is an elegant (simple) way to set a single row across all columns to a single value.

 

  I know I can do a For loop, and the For Each Row isn't quite what I'm after either.

 

  I'm almost looking for an analogous command, like For Each Column or something like that. Perhaps there doesn't exist a command that can set a single row across all columns to a given value, but I'm hoping to find a more elegant way of doing this than brute force with a For loop.

 

Thanks!,

DS

1 REPLY 1
SDF1
Super User

Re: JSL: How to set a single row across multiple columns to a single value?

I found the answer I was looking for thanks to @Craige_Hales' post here: https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013 about table subscripting.

 

There is an elegant way:  dt[row, column]=x;

 

If you want all of row 1 to be a value, you use: dt[1,0] = x. Similarly for a column and so forth.

 

This is exactly the elegant way I was looking for.

 

Hope this can help some others as well.

 

DS

Recommended Articles