Re: [R] Access only part of last dimension of table/matrix

2011-07-02 Thread Marc Schwartz
On Jul 2, 2011, at 5:39 AM, peter dalgaard wrote: > > On Jul 2, 2011, at 03:29 , Marc Schwartz wrote: > >> It actually scared me that I had any recollection of an isolated post from >> 10 years ago. Not sure what to make of that... > > If it is any consolation, the author had forgotten it enti

Re: [R] Access only part of last dimension of table/matrix

2011-07-02 Thread peter dalgaard
On Jul 2, 2011, at 03:29 , Marc Schwartz wrote: > It actually scared me that I had any recollection of an isolated post from 10 > years ago. Not sure what to make of that... If it is any consolation, the author had forgotten it entirely -- Peter Dalgaard Center for Statistics, Copenhagen

Re: [R] Access only part of last dimension of table/matrix

2011-07-02 Thread Jim Lemon
On 07/02/2011 07:50 AM, David Winsemius wrote: I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: tabfn <- function (dfrm, facvec, YN ="event"){ return( Etbl <- do.call(table, dfrm[ , c(facvec, "event") ]) ) # just want Etbl[,,,"T

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread Marc Schwartz
On Jul 1, 2011, at 8:15 PM, David Winsemius wrote: > > On Jul 1, 2011, at 7:44 PM, Marc Schwartz wrote: > >> On Jul 1, 2011, at 4:50 PM, David Winsemius wrote: >> >>> >>> I would like to do some operations inside a function using only one value >>> for the last dimension of a table/matrix: >>

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread David Winsemius
On Jul 1, 2011, at 7:44 PM, Marc Schwartz wrote: On Jul 1, 2011, at 4:50 PM, David Winsemius wrote: I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: tabfn <- function (dfrm, facvec, YN ="event"){ return( Etbl <

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread Marc Schwartz
On Jul 1, 2011, at 4:50 PM, David Winsemius wrote: > > I would like to do some operations inside a function using only one value for > the last dimension of a table/matrix: > > tabfn <- function (dfrm, facvec, YN ="event"){ > return( Etbl <- do.call(table, dfrm[ , c(facvec, "event")

Re: [R] Access only part of last dimension of table/matrix

2011-07-01 Thread David Winsemius
On Jul 1, 2011, at 5:50 PM, David Winsemius wrote: I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: Sorry, I had meant to poste a test dataset: testdf <- data.frame(x=sample(letters[1:5], 25, replace=TRUE),