On Apr 9, 2012, at 14:54 , Guaramy wrote:

> I read it believe me . The reason that a i post this is because i am making a
> thesis and a i am having this problem for over 2 weeks.
> I canĀ“t solve it and its causing me real problems.

Well, if you have a function that is not vectorized, i.e. it works for a single 
argument but not for a vector of arguments, and you want it to be vectorized, 
the tool is Vectorize(), the help page of which David pointed you to.  (This 
essentially works around the problem by creating a new function which calls the 
function one vector element at the time.)

The direct cause of your problem seems to be that if x is a vector, so is y, 
and your temp.fn returns a vector, so int.fn returns a matrix, and integrate() 
is unhappy with that.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.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.

Reply via email to