Re: [R] subsetting a list of matrices

2006-02-28 Thread Marco Geraci
Hi. Have you tried 'help.search('list')' ? See ?lapply > lapply(z, function(s) s[2:3,,drop=F]) [[1]] [,1] [,2] [1,]25 [2,]36 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [1,] 19 22 25 28 31 34 [2,] 20 23 26 29 32 35 Marco Geraci --- Federico Calboli <[E

Re: [R] subsetting a list of matrices

2006-02-28 Thread Marc Schwartz (via MN)
On Tue, 2006-02-28 at 17:14 +, Federico Calboli wrote: > Hi All, > > I have a list of matrices: > > > x > [,1] [,2] > [1,]14 > [2,]25 > [3,]36 > > y > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] 18 21 24 27 30 33 > [2,] 19 22 25 28 31 34 > [3

Re: [R] subsetting a list of matrices

2006-02-28 Thread Sundar Dorai-Raj
Federico Calboli wrote: > Hi All, > > I have a list of matrices: > > >>x > > [,1] [,2] > [1,]14 > [2,]25 > [3,]36 > >>y > > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] 18 21 24 27 30 33 > [2,] 19 22 25 28 31 34 > [3,] 20 23 26 29

Re: [R] subsetting a list of matrices

2006-02-28 Thread Gabor Grothendieck
Try this: lapply(z, "[", 2:3, TRUE) On 2/28/06, Federico Calboli <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a list of matrices: > > > x > [,1] [,2] > [1,]14 > [2,]25 > [3,]36 > > y > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] 18 21 24 27 30 33 > [2,] 1

[R] subsetting a list of matrices

2006-02-28 Thread Federico Calboli
Hi All, I have a list of matrices: > x [,1] [,2] [1,]14 [2,]25 [3,]36 > y [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18 21 24 27 30 33 [2,] 19 22 25 28 31 34 [3,] 20 23 26 29 32 35 > z =list(x,y) I want to create a second list that is