[R] Assoociative array?

From: <rkevinburton_at_charter.net>
Date: Sat, 12 Jul 2008 00:32:16 -0700


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.

Kevin



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 12 Jul 2008 - 09:45:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 Jul 2008 - 12:32:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive