Re: [R] creating a matrix subset based on a threshold cutoff

2008-03-04 Thread [EMAIL PROTECTED]
that's great, thanks On Tue Mar 4 12:29 , "Henrique Dallazuanna" sent: I think that this shoul works: do.call(rbind, apply(as.table(x), 1, function(.x).x[any(.x < cutoff)])) Change as.table(x) by your table On 04/03/2008, rich @ thevillas. eclipse. co. uk <[EMAIL

Re: [R] creating a matrix subset based on a threshold cutoff

2008-03-04 Thread Henrique Dallazuanna
I think that this shoul works: do.call(rbind, apply(as.table(x), 1, function(.x).x[any(.x < cutoff)])) Change as.table(x) by your table On 04/03/2008, rich @ thevillas. eclipse. co. uk <[EMAIL PROTECTED]> wrote: > > > > > sorry, it would probably better be described as a table > > thanks > > >

Re: [R] creating a matrix subset based on a threshold cutoff

2008-03-04 Thread [EMAIL PROTECTED]
sorry, it would probably better be described as a table thanks On Tue Mar 4 11:28 , "Henrique Dallazuanna" sent: You have a table or matrix? if is matrix: set.seed(123) x <- matrix(rnorm(100), 10, 10) cutoff <- -1.5 do.call(rbind, apply(x, 1, function(

Re: [R] creating a matrix subset based on a threshold cutoff

2008-03-04 Thread Henrique Dallazuanna
You have a table or matrix? if is matrix: set.seed(123) x <- matrix(rnorm(100), 10, 10) cutoff <- -1.5 do.call(rbind, apply(x, 1, function(.x).x[any(.x < cutoff)])) On 04/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >Hi, > > I have a table of x rows and y columns. The table is