Re: [R] R code helps needed!

2017-03-05 Thread SH
Hi Jim, I added more codes besides your original ones. I bet there should be simpler way(s) to do this but this is the best I can think of. Any feedback from you and others will be highly appreciated. Thanks a lot! Steve result<-read.table(text= "intercept decision expected.decision 1 r

Re: [R] R code helps needed!

2017-03-05 Thread SH
Hi Jim, Thank you very much for replying back. I think the data I presented have not many 'pass' than I thought. The purpose of the code is to skip sampling for 5 consecutive rows when a previous row is found as 'pass'. Thus, because the fourth row is 'pass', sampling will be skipped next five

Re: [R] R code helps needed!

2017-03-02 Thread Jim Lemon
Hi Steve, Try this: result<-read.table(text= "intercept decision 1 reject 2 reject 3 reject 0 pass 3 reject 2 reject 3 reject 5 reject 3 reject 1 reject 1 reject 2 reject 2 reject 0 pass 3 r