[R] parttioning a matrix corresponding to different levels of y

suman dhara suman.dhara89 at gmail.com
Fri Jun 4 06:59:12 CEST 2010


Sir,
I have a problem regarding partitioning a matrix.I state my problem as
follows:

I have a y vector of length say 1000.Variable y has 4 levels say
0,1,2.Corresponding to each y(response), I have a x-vector(explanatory) as a
row of X matrix.Now, I want to partition the X matrix into 3 submatrices say
x1,x2,x3  corresponding to each level of y.Is there any function to do this
in R or how can I do this in R?

For your convinience I attach a sample version of data.

Thanks,
Suman Dhara


More information about the R-help mailing list