Skip to content
Prev 319054 / 398506 Next

transpose lists

Hi,
You can try:
mat1<- do.call(rbind,x)
lapply(seq_len(ncol(mat1)),function(i) mat1[,i])
#[[1]]
#[1] 12.10? 3.44

#[[2]]
#[1] 0.1 3.0

#[[3]]
#[1] 12.0 33.1

#[[4]]
#[1]? 1.1 23.0


A.K.

----- Original Message -----
From: ishi soichi <soichi777 at gmail.com>
To: PIKAL Petr <petr.pikal at precheza.cz>
Cc: r-help <r-help at r-project.org>
Sent: Friday, March 8, 2013 5:06 AM
Subject: Re: [R] transpose lists

Thanks. The result should be a list of lists like...
[[1]]
[1] 12.10? 3.44

[[2]]
[1] 0.1 3.0

[[3]]
[1] 12.0 33.1

[[4]]
[1]? 1.1 23.0

lapply(x, t) doesn't do the job, I think.

ishida


2013/3/8 PIKAL Petr <petr.pikal at precheza.cz>
??? [[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.