[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',

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-28 Thread vanessa van der vaart
125 sample 2 1 > #135 buy 2 1 > #146 buy 4 1 > #156 sample 5 0 > #166 sample 5 0 > #177 sample 4 1 > #18 7 buy 3 1 > #197 buy 4 1 &