Hi, I'm trying to replicate your program. It may be not the same as yours, hope it helps.
## Create a vector of numbers cip <- seq(1.0,2.5,by=0.1) ## Create ecdf function Fn <- ecdf(cip) ## Create f function f <- function(x){(1-Fn(x))^4} ## Create integrate function ## Because the integrate function is not vectorized fi <- function(f,x) { res <- numeric(length(x)) for(i in 1:length(x)){res[i] <- integrate(f,x[i],2.967)$value} res} ## The final results bip <- cip + (1/f(cip))*fi(f,cip) ----- A R learner. -- View this message in context: http://r.789695.n4.nabble.com/function-of-an-integral-tp2296470p2296577.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.