PDA

View Full Version : Statistics in R


aymer
Oct18-10, 01:51 PM
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

HallsofIvy
Oct19-10, 10:21 AM
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!

aymer
Oct19-10, 11:15 AM
Hi there,
Thanx for the response.
I am using the statistical software R