hi feng,
a possible solution is
b1<-apply(a,2,list)
and possibly
lapply(b1,unlist)
if you want exactly the output equal to "list(a[, 1], a[, 2])"
best,
vito
Il 18/01/2011 13.53, Feng Li ha scritto:
Dear R,
Is there an efficient way to make a list that each element is from the
corresponding
Try this:
c(unname(as.data.frame(a)))
On Tue, Jan 18, 2011 at 10:53 AM, Feng Li wrote:
> Dear R,
>
> Is there an efficient way to make a list that each element is from the
> corresponding column of a matrix. For example, if I have a matrix "a"
>
> > a <- matrix(1:10, 5, 2)
> > a
> [,1] [,2
Dear R,
Is there an efficient way to make a list that each element is from the
corresponding column of a matrix. For example, if I have a matrix "a"
> a <- matrix(1:10, 5, 2)
> a
[,1] [,2]
[1,]16
[2,]27
[3,]38
[4,]49
[5,]5 10
I would like to have a list
3 matches
Mail list logo