Skip to content
Prev 325855 / 398503 Next

extracting submatrix from a bigger one

First of all, is your data structure a matrix or a data frame? They
are different!

Assuming the latter, a shorter version of Rui's answer that avoids
unique() and automatically takes care of names is:

result <- by(dataset, dataset$ID,I)

See ?by, ?tapply, and ?split

-- Bert
On Mon, Jun 24, 2013 at 9:24 AM, Rui Barradas <ruipbarradas at sapo.pt> wrote: