Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Peter Dalgaard
Gavin Simpson wrote: > On Mon, 2008-06-23 at 17:47 +0900, Gundala Viswanath wrote: > >> Hi, >> >> Given this vector: >> >> >>> x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , >>> 113.9) >>> >> [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113

Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Gavin Simpson
On Mon, 2008-06-23 at 17:47 +0900, Gundala Viswanath wrote: > Hi, > > Given this vector: > > > x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , > > 113.9) > [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 > > > mean.x <- mean(x) > [1] 79.63 > > I wis

Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Hans-Joerg Bibiko
On 23 Jun 2008, at 10:47, Gundala Viswanath wrote: Hi, Given this vector: x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , 113.9) [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 mean.x <- mean(x) [1] 79.63 I wish to: 1. Create a new vector (n

[R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Gundala Viswanath
Hi, Given this vector: > x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , > 113.9) [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 > mean.x <- mean(x) [1] 79.63 I wish to: 1. Create a new vector (nx) with the same size as "x" 2. Fill "nx" with the m