Skip to content
Prev 289327 / 398498 Next

R Error : DATA to MATRIX

Hi

See in text.
matrix.
I
but
(
Above lines do not do any sensible things. r shall be same as a.
#.........................................................................................
No error
No error
#.........................................................................................
No error. However in each cycle only ith row is added to R and therefore 
only last row (in this case B[6,]) is added and stays in R. Either you 
need to use

R <- c(R, B[i,])

in your construction or better as B is matrix
[1] "matrix"

you can transform it to vector easily by stripping dimensions.

 R<-t(B)
[1] 2 0 0 1 1 0 0 2 0 1 0 1 0 1 1 0 0 2

Regards
Petr
***************************************************************************
http://www.R-project.org/posting-guide.html