Hi
I am a bit curious why one shall do such a twisted construction. Accessing
list is basically the same as accessing corresponding matrix row, you only
need to remember drop=FALSE option.
Regards
Petr
r-help-boun...@r-project.org napsal dne 17.03.2010 00:58:54:
Here is a way of creating a
Hey dear users
I'm trying to kind of split my matrix which looks as follows:
dim(out)
[1] 30 12
What I finally want is each line as it's own matrix which I can handle
then separately.
Like, say:
out1- [1,]
out2-[2,]
..
Would you do that with a for() loop or does exist an other
Here is a way of creating a list of the matrices:
x - matrix(1:(12*30), nrow=30)
# create a list of single row matrices
x.l - lapply(seq(nrow(x)), function(a) x[a,, drop=FALSE])
x.l
[[1]]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
[1,]1 31 61 91 121 151
3 matches
Mail list logo