Re: [R] How to do this simple integration?

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Fri 09 Jun 2006 - 13:26:49 EST

          I can't parse your metacode, so I really don't understand your question. Have you worked the examples in the "?integrate" help page? Also, do you understand the "..." argument to the "integrate" (and other) functions"? If the answer to the latter is "no", I suggest you also read Venables and Ripley, Modern Applied Statistics with S.

          If that is not adequate and you'd like more help from this listserve, please submit a simple, self-contained example that seems to come the closest to something you want but can't quite get, as suggested in the posting guide! "www.R-project.org/posting-guide.html".

          I know this didn't answer your question, but I hope it helps you.

	  Best Wishes,
	  Spencer Graves

Jianing Di wrote:
> Hello,
>
> I have a simple function in the form as follows:
>
>> f<-function(x){sum(v^x)}
>
> where v is a vector. I was trying to integrate f using the command
>
>> I<-integrate(f,0,1)
>
> However, this will not work and seems that the reason is to use
> "integrate", the f must be a function that with input and output of same
> length. Anyone can point out which command should I use in order to
> compute this type of integration(such as a function involve sum(), prod(),
> etc.)?
>
> Thank you.
>
> Jianing
>
>



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 Fri Jun 09 13:52:17 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 Fri 09 Jun 2006 - 16:10:42 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.