[R] Assoociative array?

rkevinburton at charter.net rkevinburton at charter.net
Sat Jul 12 09:32:16 CEST 2008

I have search the archive and I could not find what I need so I will try to ask the question here. 

I read a table in (read.table)

a <- read.table(.....)

The table has column names like DayOfYear, Quantity, and Category.

The values in the row for Category are strings (characters).

I want to get all of the rows grouped by Category. The number of unique category names could be around 50. Say for argument sake the number of categories is exactly 50. Can I somehow get a vector of length 50 containing the rows corresponding to the category (another vector)? I realize I can access any row a[i]$Category (right?). But I wanta vector containing the rows corresponding to each distinct Category name. 

Thank you.


More information about the R-help mailing list