[R] Vectorize (scalar) function

2012-03-23 Thread casperyc
Hi all, myint=function(mu,sigma){ integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value } x=seq(0,50,length=3000) x=x[-1] plot(x,myint(4,x)) # not working yet I think I have to 'Vectorize' it somehow? What's a scalar function? and a primitive function? Thanks. casper

Re: [R] Vectorize (scalar) function

2012-03-23 Thread R. Michael Weylandt
? Vectorize is the one you need here. primitives are probably more subtle than you need and there's no such thing as a scalar function by that name. Michael On Fri, Mar 23, 2012 at 5:12 PM, casperyc caspe...@hotmail.co.uk wrote: Hi all, myint=function(mu,sigma){