[R] binding vectors or matrix using their names

Rolf Turner rolf at math.unb.ca
Thu Mar 25 14:11:38 CET 2004


Well, I ***liked*** Patrick's approach.  Why?  Because it's basically
straightforward.  You put together a character string by pasting
together the names of the objects you want to do things to, and the
things (operations) you want to do to them.  Then you get R to
``execute'' this string just as if you had typed it in to the
keyboard.  This seems an obvious and sensible approach to the problem
and is completely generalizable.

There is no obfuscation (making things obscure) involved.

The solutions involving do.call() are much more ***elegant*** and
doubtless far less prone to pitfalls.  However they are far less
obvious and thereby much more obscure, so it is the do.call()
solutions that deserve the ``obfuscation'' descriptor if anything
does.

				cheers,

					Rolf Turner
					rolf at math.unb.ca




More information about the R-help mailing list