Skip to content
Prev 334218 / 398502 Next

How to coerce an object name to character vector?

Don:

I defer to your judgment as to whether this was what the OP wanted,
but I think you would agree that the idiom of assign()ing to the
global workspace from within a function is almost always a bad idea in
R. Unfortunately, a better alternative, which frequently involves
building up a list structure of some sort, depends on context and, in
particular, on what further is to be done with the assigned objects,
which usually we (and sometimes the poster) don't know.

While assign() and friends certainly exist and allow script-like
programming if that is how one wishes to proceed, my understanding is
that it circumvents the functional-style programming paradigm that R
naturally supports. So I would urge those who wish to partake of the
"zen" of R to expunge get() and assign() from their R programming
vocabulary and perhaps read up a bit on functional programming, which
is really kinda cool.

Contrary opinions most definitely welcome! The stock awaits me in the
public squaRe.

Best,
Bert
On Mon, Dec 9, 2013 at 3:34 PM, MacQueen, Don <macqueen1 at llnl.gov> wrote: