I am having the following error in my function

function(theta,reqdIRR)
{
theta1<-theta[1]
theta2<-theta[2]
n<-length(reqdIRR)
constant<- n*(theta1+theta2)
sum1<-lapply(reqdIRR*exp(theta1),FUN = sum)
sum2<-lapply(exp(theta2 - reqdIRR*exp(theta1)),FUN = sum)
sum = sum1 + sum2
log.fcn = constant - as.numeric(sum)
result = - log.fcn
return(result)
}

*error :  neg.log.gumbel(1,reqdIRR)
Error in sum1 + sum2 : non-numeric argument to binary operator
>

how can i rectify the error?Its really urgent...

*

	[[alternative HTML version deleted]]

