I'm using JSL to assist users in mass recoding, but the Recode window always opens with "New Column" as the default behavior when I always want to recode "In Place".
Is there anyway to have the Recode window open with "In Place" as the default, either through something like dt<<Recode(Default("In Place")), or an option somewhere in preferences to change the default setting of the Recode window.
(Sidenote: I recognize the usefulness of creating a new column through this window, but it's a bit odd that "Recode" defaults to anything other than "In Place")
It is not odd at all if you work in one of many areas where that default 'in place' destination is considered dangerous. JMP decided to err on the side of safety.
The Scripting Index shows that the << Recode message does not take any arguments at this time:
I'll echo @markbailey and say it's a great practice to retain the original values by recoding into a new column (if only to allow a user to undo a mistake down the line). In scripting cases like these, I've found myself allowing Recode to make the new column, but will immediately hide and rename the original, then rename the new column to take the place of the original. As far as the end user is concerned it's a recode in place, but they have that hidden original column as a backup.
That said, if you need to change the Recode dialog to "In Place" you can do that by sending a message to the Combo box of the window. Here's a quick example hard referencing the window (since var = dt << recode doesn't return a window ref to var):
Hopefully this gets you a little bit closer?
Thanks, Julian, I'll start there :)
I still disagree that "New Column" is the best choice for a default setting.
If I recode a column that is essential for scripts that attached to the datatable and/or formula columns that reference the column-of-interest, then I have to do one of two things:
Although these options might be relatively painless, they're not good uses of users' time (especially when you have users who are prone to forgetting small details such as this) and we could easily have a solution that both eliminates the need for either option and still gives you a back-up column for security.
How? What I would prefer to see is "In Place" being the default for this window (mirroring previous versions' Recode functionality, if I recall correctly), and then a new checkbox in the window (defaulted to True?) for "Create Hidden Back-Up Column", which would create the *_BackUp column for me automatically (and now I don't have to update any scripts/formulas or take time to manually shuffle around column names).
You make a good point about tables with formulas or scripts. In that case, making the hidden backup column first, and then recoding in place, makes a lot of sense! Here's a snip of code to do that sort of thing (using a column named "age" as the example)
col = column("age"); Eval(col << Get script) << set name(col<<Get Name|| "_backup") << hide;
Having a hidden backup column as an option in Recode itself could be really useful to some. I'd encourage you to copy your suggestion over the JMP Wish List so our developers see it.