Re: [R] Need help with function that includes 2 summation

2007-10-17 Thread Henrique Dallazuanna
Perhaps: r <- function(n, k, theta){ return(sqrt((sum(cos(k*theta))^2 + sum(sin(k*theta))^2)/n)) } On 17/10/2007, Zack Darnell <[EMAIL PROTECTED]> wrote: > > I am relatively new to R, so this may be a much simpler question than it > seems to me. I am trying to create a function that includes

Re: [R] Need help with function that includes 2 summation

2007-10-17 Thread Romain Francois
Zack Darnell wrote: > I am relatively new to R, so this may be a much simpler question than > it seems to me. I am trying to create a function that includes two > summations, and can't figure out how. I am attaching the equation as a > pdf file. This function will then be optimized over a chosen

[R] Need help with function that includes 2 summation

2007-10-17 Thread Zack Darnell
I am relatively new to R, so this may be a much simpler question than it seems to me. I am trying to create a function that includes two summations, and can't figure out how. I am attaching the equation as a pdf file. This function will then be optimized over a chosen range of values, but right