[BioC] Dynamic Function creation

Davide Rambaldi davide.rambaldi at ifom-ieo-campus.it
Thu Mar 10 12:23:11 CET 2011


Hello, may be is not the correct place to ask this but: it is possible to create functions in R dynamically? 

(May be the correct name is anonymous functions ....)

I want something like:

a <- function(parS,xx) { parS$a^2 + parS$M }
b <- function(parS,xx) { parS$b^2 + parS$M }

c <- a + b

where c is:

function(parS,xx) {  parS$a^2*exp(-((xx-parS$M)^2)/(2*parS$S^2))  + parS$b^2*exp(-((xx-(parS$M - parS$D))^2)/(2*parS$S^2)) }

Regards


Davide R.



More information about the Bioconductor mailing list