Skip to content
Prev 142359 / 398498 Next

Odp: matrix problem

Hi

Not sure what you want to do. 
You can set dimensions to your vector.

vec<-1:12
dim(vec)<-c(3,4)

you can repeat your vector for n times

vec<-rep(1:4,3)
dim(vec) <- c(4,3)

or you can use byrow option

vec<-1:12
matrix(vec, nrow=4, ncol=3, byrow=T)


Petr Pikal
petr.pikal at precheza.cz
724008364, 581252140, 581252257


r-help-bounces at r-project.org napsal dne 21.04.2008 11:54:03:
http://www.R-project.org/posting-guide.html