[R] counting values with some conditions in a simulation

2011-11-25 Thread Sl K
Dear R users, I am running simulations (1000), and in my simulation I am looking at specific sums. For example, if the sum is >=4 then count this, if say <3, then don't count, if the sum=3, then generate a random number from uniform distribution, if this number is say less than 0.5, then count thi

[R] how to count number of occurrences

2011-11-02 Thread Sl K
Dear R users, I have this data frame, y samp 8 0.03060419X 18 0.06120838Y 10 0.23588374X 3 0.32809965X 1 0.36007100X 7 0.36730571X 20 0.47176748Y 13 0.65619929Y 11 0.72014201Y 17 0.73461142Y 6 0.76221313X 2 0.77005691X 4 0.92477243