[R] filling array with functions

derek jan.kacaba at gmail.com
Fri Apr 22 19:02:21 CEST 2011


Hello R,

I would like to find out how to generate array full of functions. I tried it
like this:

fv=array(,dim=c(1,10))
V=c(1:10)
for (i in 1:10){
fv[i]<-function(x)(V[i]-b*a*x) # b, x are constants.
}

But it returns:
"incompatible types (from closure to logical) in subassignment type fix"


--
View this message in context: http://r.789695.n4.nabble.com/filling-array-with-functions-tp3468313p3468313.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list