[R] doubt with integrate ()

From: Rogério Rosa da Silva <rogeriorosas_at_gmail.com>
Date: Sun 04 Jun 2006 - 00:28:30 EST

Dear members,

I'm getting an error with the "integrate" function. Searching in the r-help archives, I think this may have something to do with the function (it is not returning a vector but a number), but I don't see exactly what.

The function to integrate was defined with a for loop first:

    for (i in 1:(nbcol-1))

{density(tdon11, bandwidth=h[i], kernel="gaussian")$y}

    for (j in (i+1):nbcol)



    integrate(diffctk,-Inf,Inf,subdivisions=100)$integral ,

    h <- 1.06*ect*(nlc^-0.2); ect <- apply (data,2,sd); nlc <- length of each column in data, excluding NA's

The result gives the error:

    "Error in integrate (diffctk, -Inf, Inf, subdivisions = 100) :

        evaluation of function gave a result of wrong length"

Is the any way finding these error? I would be happy to be enlightened.

Best regards,


        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jun 04 01:04:04 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 04 Jun 2006 - 08:10:30 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.