Re: [R] extracting index list when using tapply()

2008-07-09 Thread hesicaia
jholtman wrote: > > Working code would help. I would probably use 'lapply' since it > appears that you want to return a variable number of items for each > condition. > > On Tue, Jul 8, 2008 at 2:23 PM, hesicaia <[EMAIL PROTECTED]> wrote: >> >> Hello, >> The quick version of my question is h

Re: [R] extracting index list when using tapply()

2008-07-08 Thread jim holtman
Working code would help. I would probably use 'lapply' since it appears that you want to return a variable number of items for each condition. On Tue, Jul 8, 2008 at 2:23 PM, hesicaia <[EMAIL PROTECTED]> wrote: > > Hello, > The quick version of my question is how can I extract a matrix instead o

Re: [R] extracting index list when using tapply()

2008-07-08 Thread Charles C. Berry
On Tue, 8 Jul 2008, hesicaia wrote: Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to be able to access both the results of tapply() and also the index variables. In case further explanation would help: I am analyzing a

Re: [R] extracting index list when using tapply()

2008-07-08 Thread ctu
Hi, How about using "subset"? x1<-tapply(subset(years, length(area)>20), function(x) length(unique(x))) I hope this works Chunhao Quoting hesicaia <[EMAIL PROTECTED]>: Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to

[R] extracting index list when using tapply()

2008-07-08 Thread hesicaia
Hello, The quick version of my question is how can I extract a matrix instead of a vector using tapply()? I would like to be able to access both the results of tapply() and also the index variables. In case further explanation would help: I am analyzing a large (3million rows x 9 columns) spa