cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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