[R] question on indexing of a matrix

Roger Levy rog at stanford.edu
Sat Feb 12 20:21:35 CET 2005


Hi,

I have a k-level factor F of length n that I would like to use to
extract from an n-by-k matrix M a vector V such that

  V[i] = M[i,as.numeric(F)[i]]

I don't currently understand how to do that in R -- can anyone explain
to me how to do so?

Thanks,

Roger Levy




More information about the R-help mailing list