One option would be

x <- list(c(12.1, 0.1, 12, 1.1), c(3.44, 3, 33.1, 23))
do.call(c, apply(do.call(rbind, x), 2, list))

HTH,
Jorge.-



On Fri, Mar 8, 2013 at 9:06 PM, ishi soichi <soichi...@gmail.com> wrote:

> Thanks. The result should be a list of lists like...
>
> > x
> [[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.pi...@precheza.cz>
>
> > Hi
> >
> > > -----Original Message-----
> > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> > > project.org] On Behalf Of ishi soichi
> > > Sent: Friday, March 08, 2013 10:50 AM
> > > To: r-help
> > > Subject: [R] transpose lists
> > >
> > > Can you think of a function that transposes a list like
> >
> > What shall be the result of transposed list?
> >
> > Something like
> >
> > lapply(x, t)
> >
> > Regards
> > Petr
> >
> > >
> > > > x
> > > [[1]]
> > > [1] 12.1  0.1 12.0  1.1
> > >
> > > [[2]]
> > > [1]  3.44  3.00 33.10 23.00
> > >
> > > ?
> > >
> > > ishida
> > >
> > >       [[alternative HTML version deleted]]
> > >
> > > ______________________________________________
> > > R-help@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.
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to