Hi!

I am a beginner of R. I am trying to calculate integrate and draw a graph of the output, but just kept on getting error messages. I list my program and error message below. Please help. Many Thanks!

=======================
+ > a<--11 
> b<-0.1
> c<-0.012
> x<-0:110
> t<-0:15
> integrand<-function(x) {exp(-exp(a-c*t)*(exp(b*x)-exp(c*x))/(b-c))}
> cal<-integrate(integrand,0,Inf)
Error in integrate(integrand, 0, Inf) : evaluation of function gave a result of wrong length
In addition: Warning message:
longer object length
        is not a multiple of shorter object length in: -exp(a - c * t) * (exp(b * x) - exp(c * x)) 
> plot(cal~t, xlab="Time", ylab="Pop at t")
Error in model.frame(formula, rownames, variables, varnames, extras, extranames,  : 
        invalid variable type
===========================

- Vivien Chen -
	[[alternative HTML version deleted]]


