If I understood correctly,

lapply(x, "[", 1:3)

will do what you want.

HTH,
Jorge.-


On Fri, Mar 8, 2013 at 5:05 PM, ishi soichi <> wrote:

> hi. I have a list like
>
> x <- list(1:10,11:20,21:30)
>
> It's a sort of a 3 x 10 matrix in list form.
> I would like to reduce the dimension of this list.
>
> it would be something like
>
> list(1:3, 11:13, 21,23)
>
> I tried
>
> x[,1:3]
>
> does not work of course. Neither
>
> lapply(x, [1:3])
>
> works...
>
> Any suggestions?
>
> 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.

Reply via email to