[R] function input as variable name (deparse/quote/paste) ??
hans at sociologi.cjb.net
Sat Mar 10 23:46:26 CET 2012
On Sat, Mar 10, 2012 at 01:29:16PM -0800, casperyc wrote:
> Hi all
> Say I have a function:
> for various input such as
> how should I modify the 'res' line, to have new informative variable name
> correspondingly, such as
> stored in the workspace.
Why not keep the information of input values in a list, or vector?
What is gained by storing that info in the variable _name_ ? Your
function could return a list with both the result and the input value.
While you did say that this was part of something complex, I suspect
your post might be a case of "Being overly specific and not stating
your real goal."
Hans Ekbrand (http://sociologi.cjb.net) <hans at sociologi.cjb.net>
More information about the R-help