Re: [R] getting data from table command

2010-07-11 Thread nn roh
Thanks very much :). On Sat, Jul 10, 2010 at 10:02 PM, jim holtman wrote: > Is this what you want: > > > x <- c(1,2,2,2,3,3,3,4,4,5) > > z <- table(x) > > z > x > 1 2 3 4 5 > 1 3 3 2 1 > > as.integer(rep(names(z), z)) > [1] 1 2 2 2 3 3 3 4 4 5 > > > > > On Sat, Jul 10, 2010 at 10:55 AM, nn roh

Re: [R] getting data from table command

2010-07-10 Thread Linlin Yan
> d <- 1:4 > f <- c(2,3,3,1) > rep(d,f) [1] 1 1 2 2 2 3 3 3 4 On Sat, Jul 10, 2010 at 10:55 PM, nn roh wrote: > Hi, > > I have a question relating to R package > > If i  have the frequencies of data   how i can get the data  as following : > > 1 2 3 4      data > 2 3  3 1      frequency > > Whic

Re: [R] getting data from table command

2010-07-10 Thread jim holtman
Is this what you want: > x <- c(1,2,2,2,3,3,3,4,4,5) > z <- table(x) > z x 1 2 3 4 5 1 3 3 2 1 > as.integer(rep(names(z), z)) [1] 1 2 2 2 3 3 3 4 4 5 > On Sat, Jul 10, 2010 at 10:55 AM, nn roh wrote: > Hi, > > I have a question relating to R package > > If i  have the frequencies of data   how