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

[R] R code helps needed!

2017-03-02 Thread SH
Hi Although I posted this in stackoverflow yesterday, I am asking here to get helps as soon as quickly. I need help make code for mocking sampling environment. Here is my code below: First, I generated mock units with 1000 groups of 100 units. Each row is considered as independent sample space.