Re: [R] Conditional Splitting a Vectors into Two Vectors

2010-07-06 Thread Henrique Dallazuanna
You can't try this also: split(x, count > 0) On Tue, Jul 6, 2010 at 3:39 AM, Gundala Viswanath wrote: > Suppose I have two vectors of same dimensions: > >x <-c(0.49534,0.80796,0.93970,0.8) >count <-c(0,33,0,4) > > How can I group the vectors 'x' into two vectors: > > 1. Vector

Re: [R] Conditional Splitting a Vectors into Two Vectors

2010-07-06 Thread Christos Argyropoulos
One possible way is the following: x <-c(0.49534,0.80796,0.93970,0.8) count <-c(0,33,0,4) x[count==0] [1] 0.49534 0.93970 > x[count>0] [1] 0.80796 0.8 Christos > Date: Tue, 6 Jul 2010 15:39:08 +0900 > From: gunda...@gmail.com > To: r-h...@stat.math.ethz.ch > Subject: [R] Conditional

Re: [R] Conditional Splitting a Vectors into Two Vectors

2010-07-06 Thread Peter Ehlers
On 2010-07-06 0:39, Gundala Viswanath wrote: Suppose I have two vectors of same dimensions: x<-c(0.49534,0.80796,0.93970,0.8) count<-c(0,33,0,4) How can I group the vectors 'x' into two vectors: 1. Vector `grzero` that contain value in x with `count` value greater than 0 and