But you code is just creating a single value.  "q" is the "sum(A)" which is
a single value.  What were you expecting?


Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Mon, Jul 7, 2014 at 7:03 AM, thanoon younis <thanoon.younis80@gmail.com>
wrote:

> dear R-users
> i am new on R-program so i need your help to solve the root mean square
> equation  in R. i have a problem in summation (r=1:100)how can i write it
> in R . i tried to write the code as below but the problem is the result
> must be vector not constant number as code below.
>
> i appreciate any help
>
> thanks alot for all
>
> p<-23
> r<-100
> x<-c(1.098,0.995, 1.078, 1.098, 1.034, 1.009, 1.070, 0.996, 1.070, 0.827,
> 0.651, 1.032, 0.841, 0.769, 0.860, 0.717, 0.847, 1.008, 0.833, 0.806,
> 0.273, 0.934, 0.321)
> y<-c(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
> 1.0,0.7,0.7,0.8,0.8,0.7,0.7,0.6,0.6,0.8,0.8,1.0,0.3,1.0,0.3)
> w<-x-y
> A<-(w)^2
> q<-sum(A)
> z<-1/100*q
> t<-sqrt(z)
> t
>
> ______________________________________________
> 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.
>
>

	[[alternative HTML version deleted]]

