Re: [R] Duplicated function with conditional statement

2013-07-28 Thread vanessa van der vaart
gt; #208 buy 5 0 > #21 8 sample 4 1 > #228 buy 2 1 > > A.K. > > > - Original Message - > From: arun > To: vanessa van der vaart > Cc: David Winsemius ; R help > > Sent: Saturday, July 27, 2013 9:11

Re: [R] Duplicated function with conditional statement

2013-07-27 Thread arun
ate and sorted these 10. unique(unlist( #unlist the list and choose only the unique elements 11. dat[unique(unlist(,newColumn]<-1 # assign those rows that fits the condition in newColumn as 1. Hope it helps. Regards, A.K.   ____ From: vanessa

Re: [R] Duplicated function with conditional statement

2013-07-27 Thread arun
buy   2  1 A.K. - Original Message - From: arun To: vanessa van der vaart Cc: David Winsemius ; R help Sent: Saturday, July 27, 2013 9:11 PM Subject: Re: [R] Duplicated function with conditional statement HI, May be this is what you wanted. #using tt1 indx<-which(tt1$respons

Re: [R] Duplicated function with conditional statement

2013-07-27 Thread arun
, let me change the >conditional statement, I hope you can understand. i will explain by >example > >as you can see, almost every number is duplicated, but only in row 6th,7th,and >9th the value on column is 1. > >on row4th, the value is duplicated( 2 already occurred on 2nd ro

Re: [R] Duplicated function with conditional statement

2013-07-27 Thread vanessa van der vaart
hope you can understand. i will explain by > example > > as you can see, almost every number is duplicated, but only in row > 6th,7th,and 9th the value on column is 1. > > on row4th, the value is duplicated( 2 already occurred on 2nd row),but > since the value is considered as d

Re: [R] Duplicated function with conditional statement

2013-07-26 Thread arun
onse is 'buy' than the value on column, on row4th still zero.  On row 6th, where the value product column is 3. 3 is already occurred in 3rd row where the value on response is 'buy', so the value on column should be 1 I hope it can understand the conditional statement.

Re: [R] Duplicated function with conditional statement

2013-07-26 Thread David Winsemius
On Jul 26, 2013, at 2:06 PM, David Winsemius wrote: > > On Jul 26, 2013, at 11:51 AM, Uwe Ligges wrote: > >> >> >> On 25.07.2013 21:05, vanessa van der vaart wrote: >>> Hi everybody,, >>> I have a question about R function duplicated(). I have spent days try to >>> figure this out,but I cant

Re: [R] Duplicated function with conditional statement

2013-07-26 Thread David Winsemius
On Jul 26, 2013, at 11:51 AM, Uwe Ligges wrote: > > > On 25.07.2013 21:05, vanessa van der vaart wrote: >> Hi everybody,, >> I have a question about R function duplicated(). I have spent days try to >> figure this out,but I cant find any solution yet. I hope somebody can help >> me.. >> this is

Re: [R] Duplicated function with conditional statement

2013-07-26 Thread Uwe Ligges
On 25.07.2013 21:05, vanessa van der vaart wrote: Hi everybody,, I have a question about R function duplicated(). I have spent days try to figure this out,but I cant find any solution yet. I hope somebody can help me.. this is my data: subj=c(1,1,1,2,2,3,3,3,4,4) response=c('sample','sample','

[R] Duplicated function with conditional statement

2013-07-26 Thread vanessa van der vaart
Hi everybody,, I have a question about R function duplicated(). I have spent days try to figure this out,but I cant find any solution yet. I hope somebody can help me.. this is my data: subj=c(1,1,1,2,2,3,3,3,4,4) response=c('sample','sample','buy','sample','buy','sample',' sample','buy','sample',