How to Sum a Function with a Free Parameter in R?

  • Level: Undergrad 
  • Thread starter aymer
  • Start date
  • Tags Tags
    Statistics
2 replies · 2K views · last reply
aymer
Messages
16
Reaction score
0
Hey everyone,

This is for someone who has used R. Please tell me how can we sum a function with a free parameter in R.
I used the normal command f=function(n) sum(body of function containing n)
it does not show any warnings till here, but when I plot this sum vs n (which i now define as a sequence, n=seq(-1.2,0.8)), it shows that the two quantities have differing lengths.

How can this be if my sum is a function of n?
Did I define the sum incorrectly?

Please help
 
You talk about the "command" "f=function(n) sum(body of function containing n)" so apparently you are using some computer algebra system. But we cannot help you without know which system (Maple, Mathematica, ...) you are using!
 
Hi there,
Thanx for the response.
I am using the statistical software R