Hi all,
#####################################
integ=function(f,n){
# computes vector y = f(x)
x=runif(10000)
y=f
hatI=mean(y)
hatI
}
# example of use
integ(x^2+x+100,100)
#####################################
it returns an error says no obj 'x'
how do I 'tell' R to treat 'f' as an input expression?
Thanks.
casper
View this message in context: http://r.789695.n4.nabble.com/how-to-use-expression-as-function-arguements-tp3093940p3093940.html Sent from the R help mailing list archive at Nabble.com.