Vectorize!
Here is an email sent by one of my students a few days ago: Do you know how to integrate a function with an “if”? For instance: __X=rnorm(100) __Femp=function(x){ + return(sum(Xintegrate(Femp,0,1)$value does not work. My reply was that the fundamental reason it does not ... [Read more...]