Hi,
I can get from a string to a function with this name:
f1 - function(x){ mean(x) }
do.call(f1,list{1:4})
get(f1)
etc...
But how do I get from a function to its name?
funcVec - c(f1,median)
funcVec
[[1]]
function(x){ mean(x) }
str(funcVec)
List of 2
$ :function (x)
..- attr(*, source)=
On Mar 2, 2007, at 9:42 AM, Ido M. Tamir wrote:
Hi,
I can get from a string to a function with this name:
f1 - function(x){ mean(x) }
do.call(f1,list{1:4})
get(f1)
etc...
But how do I get from a function to its name?
funcVec - c(f1,median)
funcVec
[[1]]
function(x){ mean(x) }
I
On Fri, Mar 02, 2007 at 03:42:46PM +0100, Ido M. Tamir wrote:
Hi,
I can get from a string to a function with this name:
f1 - function(x){ mean(x) }
do.call(f1,list{1:4})
get(f1)
etc...
But how do I get from a function to its name?
funcVec - c(f1,median)
funcVec
[[1]]
Charilaos Skiadas wrote:
On Mar 2, 2007, at 9:42 AM, Ido M. Tamir wrote:
But how do I get from a function to its name?
Can you do this with any object in R?
In what situation will you be wanting this name? I mean, how would
you be given this object, but not know its name in advance? If it
Ido M. Tamir [EMAIL PROTECTED] writes:
I wanted to pass a vector of functions as an argument to a function to do
some
calculations and put the results in a list where each list entry has
the name of the function.
I thought I could either pass a vector of function names as character, then
,
Bert Gunter
Genentech Nonclinical Statistics
South San Francisco, CA 94404
650-467-7374
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Seth Falcon
Sent: Friday, March 02, 2007 9:18 AM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] from function to its name
Check out:
https://stat.ethz.ch/pipermail/r-help/2006-October/114431.html
On 3/2/07, Ido M. Tamir [EMAIL PROTECTED] wrote:
Charilaos Skiadas wrote:
On Mar 2, 2007, at 9:42 AM, Ido M. Tamir wrote:
But how do I get from a function to its name?
Can you do this with any object in R?
In