Re: [R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-19 Thread beiyu
thx very much -- View this message in context: http://r.789695.n4.nabble.com/Error-in-1-ue-non-numeric-argument-to-binary-operator-tp3917605p3917871.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list http

Re: [R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-19 Thread R. Michael Weylandt
Short answer since it's late: integrate doesn't return a number (directly): add $value somewhere (either on the integrate() output before assignment or on later use of ue) and you should be fine. Michael On Wed, Oct 19, 2011 at 1:11 AM, beiyu wrote: > hi, I have a problem. The R shows that > Er

[R] Error in 1/ue : non-numeric argument to binary operator.

2011-10-18 Thread beiyu
hi, I have a problem. The R shows that Error in 1/ue : non-numeric argument to binary operator. Here is the code: # simulation of tempered stable processes by compound Poisson approximation tsp<-function(n,e,a,c,lema){ x<-numeric(n) for (i in 1:n){ repeat{ w<-runif(1) v<-runif(1) x<-e*