[R] Passing function to tapply as a string
Henrique Dallazuanna
wwwhsd at gmail.com
Fri Mar 7 12:21:59 CET 2008
Yes,
tapply(rnorm(100), gl(5,20), "max")
On 07/03/2008, Yuri Volchik <yuri.volchik at gmail.com> wrote:
>
> Hi,
>
> Was wondering if it is possible to pass function name as a parameter, smth
> along this line
>
> param.to.pass<-c(1,'max','h')
>
> dd<-function(dfd, param=param.to.pass,...){
> ttime.int <- format(ttime,fmt)
> data.frame(
> param[3] = tapply(dfd[,param[1]],ttime.int,param[3]),
> ...)
> }
>
>
> I know there is a as.formula expression but not quite sure if there is some
> way to accomplish what i need.
> Thanks
> --
> View this message in context: http://www.nabble.com/Passing-function-to-tapply-as-a-string-tp15891151p15891151.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>
--
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O
More information about the R-help
mailing list