[R] matrix manipulations

Anup Nandialath anup_nandialath at yahoo.com
Wed Feb 28 18:28:33 CET 2007


Dear friends,

I have a basic question with R. I'm generating a set
of random variables and then combining them using the
cbind statement. The code for that is given below.

for (i in 1:100)
  {
    y <- rpois(i,lambda=10)
    X0 <- seq(1,1,length=i)
    X1 <- rnorm(i,mean=5,sd=10)
    X2 <- rnorm(i,mean=17,sd=12)
    X3 <- rnorm(i,mean=3, sd=24)
    ind <- rep(1:5,20)
  }
  
data100 <- cbind(y,X0,X1,X2,X3,ind)

but when i look at the data100 table, the y values now
take the observation count. (ie) the data under Y is
not the poisson random generates but the observation
number. Hence the last vector (ind) does not have a
header. Is there any way i can drop the number of
observation counts being added into the matrix.

Thanks in advance for your help.

Sincerely

Anup



"However bad life may seem, there is always something you can do and succeed at. While there is life, there is hope." Stephen Hawking

Anup Menon Nandialath
*********************************************************
http://www.soundclick.com/bands/7/tailgunner_music.htm  *
*********************************************************


 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.



More information about the R-help mailing list