- Get all columns using << Get Column Names
- Set table to not update using << begin data update
- Loop over them using For Each
- Check if their name has (rad) in it using Contains / Starts With / Ends With
- Use For Each Row to loop over it and change the values to degrees
- I would hope there was better method for this, but I'm not sure if there really is unless you wish to create new columns and delete old as we shouldn't use << set each value which makes to extremely easy to do and read
- Apply Formula in place (added in JMP18) might work but it is difficult to understand how to use it
- Using matrix values is one good option but For Each Row will work always, always good idea to learn it
- Use substitute and << Set Name to rename the column
- let table update again using << end data update
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(2),
Compress File When Saved(1),
New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([., .])),
New Column("a (rad)", Numeric, "Continuous", Format("Best", 12), Set Values([1, .]))
);
colnames = dt << Get Column Names(Continuos, "String");
dt << Begin Data Update();
For Each({colname}, colnames,
If(Contains(colname, "(rad)"),
For Each Row(dt, Column(dt, colname)[] = Column(dt, colname)[] * 180 / Pi());
Column(dt, colname) << Set Name(Substitute(colname, "(rad)", "(deg)"));
)
);
dt << End Data Update();
Write();
-Jarmo