[R] Problem with indexing (subscript out of bounds)

Nils Trebing nils.trebing at gmx.de
Mon Dec 12 00:15:50 CET 2005


Ferdinand Alimadhi wrote:

> There are two ways to index the matrices, using indexes of the row and 
> columns or using names of rows and columns.
> In your example, it seems that you need to index your matrix by row names.
> 
> X[rownames(X) %in% 17:19, ]
> 
> could give the result you want.

Thanks a lot, this did the trick!

Regards,
Nils




More information about the R-help mailing list