On Thu, 2006-10-05 at 22:41 +0200, Søren Højsgaard wrote:
> I've defined the function
>
> getFunNames <- function(FUN){
> if (!is.list(FUN))
> fun.names <- paste(deparse(substitute(FUN)), collapse = " ")
> else
> fun.names <- unlist(lapply(substitute(FUN)[-1], function(a) paste(a)))
> fun.names
> }
Hi,
Try this:
> getFunNames <- function(x)
+ sapply(as.list(sys.call()[[2]][-1]),as.character)
> getFunNames(c(mean,ff))
[1] "mean" "ff"
> foo <- function() getFunNames(c(mean,ff))
> foo()
[1] "mean" "ff"
HTH,
Jerome
--
Jerome Asselin, M.Sc., Agent de recherche, RHCE
CHUM -- Centre de recherche
3875 rue St-Urbain, 3e etage // Montreal QC H2W 1V1
Tel.: 514-890-8000 Poste 15914; Fax: 514-412-7106
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.