[R] R-how to group the data

From: Subhabrata <subhabratapal_at_sraindia.com>
Date: Fri 09 Dec 2005 - 23:19:32 EST

Hello R - users,

This may sound simple to may people:

I have a list of data as follows

     type value
      y 7
      y 7
      y 8
      y 8
      y 8
      y 9
      y 9
      y 9
      y 9
      y 10
      y 10
      y 10
      y 10
      y 11
      y 11
      y 12
      y 12
      y 14
      y 14
      y 14
      y 15
      y 17
      y 20
      y 20
      y 20
      y 20
      y 25
      y 25
      y 25
      x 7
      x 7
      x 8
      x 8
      x 9
      x 9
      x 11
      x 11
      x 11
      x 12
      x 12
      x 12
      x 13
      x 13
      x 15
      x 15
      x 15
      x 18
      x 20
      x 30
      x 30

Is there any way where I can group all the x and y like

a <- all the values of x
b <- all the values of y

so 'a' will have = 7, 7, 8....

    'b' = 7,7,8,8,8...

With Regards
Subhabrata Pal



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Dec 09 23:26:51 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:35 EST