Hi Nathalie, It should be "subdivisions" in the line: > for (i in 1:length(x)){res[i] <- integrate(f,x[i],2.967, > subdivision=2000)$value}
R is trying to pass the argument "subdivision" to your function f. --Gray On Wed, Jul 28, 2010 at 2:27 PM, Nathalie Gimenes <ncgmsanc...@gmail.com> wrote: > Dear all, > > I tried once to create one variable called bip such that: > bip <- cip + (1/f(cip))*fi(f,cip) > > And this was working. > But now, doing the same thing I did before, the software shows me the > following message: > > Error in f(x, ...) : unused argument(s) (subdivision = 2000) > > I have the variable cip and the variable bip should be created such that: > Fn <- ecdf(cip) > f <- function(x) {(1 - Fn(x))^4} > fi <- function(f,x) { > res <- numeric(length(x)) > for (i in 1:length(x)){res[i] <- integrate(f,x[i],2.967, > subdivision=2000)$value} > res} > bip <- cip + (1/f(cip))*fi(f,cip) > > Is there anything wrong? How can I solve this problem? > > Thanks in advance! > > NGS > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > -- Gray Calhoun Assistant Professor of Economics, Iowa State University http://www.econ.iastate.edu/~gcalhoun/ ______________________________________________ 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.