[R] reduce the size of list

2013-03-07 Thread ishi soichi
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?

Re: [R] reduce the size of list

2013-03-07 Thread Jorge I Velez
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

Re: [R] reduce the size of list

2013-03-07 Thread ishi soichi
thanks! It works. I couldn't possibly figure out such trick... soichi 2013/3/8 Jorge I Velez jorgeivanve...@gmail.com 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 -