2
Good afternoon, I have the following code in R
funcao<-function(delta) {delta}
Intensity2AccumulationFactor<-function(delta,s,t){
int<-function(s,t) {integrate(funcao,s,t)}
p=int(s,t)
b=c(p)
a=exp(b)
print(a)
}
When testing gives the following error:
Intensity2accumulationfactor(function,0,1) Error in Exp(b) : non-numeric argument to Mathematical Function
someone can help me?
The aim is to calculate 1/(-integral(delta))
amid s
and t
.
Which error? Edit the question and add the error to make it easier to get an answer. :)
– Luiz Vieira
When testing gives the following error > Intensity2accumulationfactor(function,0,1) Error in Exp(b) : non-numeric argument to Mathematical Function
– Andreia Silva
Andreia, edit the question to add the error there. Do not post as comment. If possible, add also the line where the error occurs (note that I formatted your code to try to make it more readable, but I don’t know if it’s still there for you in rstudio - correct if it’s not, ok?).
– Luiz Vieira