[R] Vector to Matrix transformation
ccleland at optonline.net
Tue Jan 23 15:29:35 CET 2007
Shubha Vishwanath Karanth wrote:
> Hi R,
> I have a vector V1 of unknown length, say n. I need to convert this into
> a matrix C of row size=5, and accordingly the column should be updated.
> I tried with:
> But it is not working...Could somebody help me on this?
You could try the following:
but note what happens when the length of V1 is not a multiple of 5.
> Thanks in advance...
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Chuck Cleland, Ph.D.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894
More information about the R-help