how many heads and how many tails?
After writing the function with unequal probabilities, how do we check on R, how many heads and how many tails were drawn in a sample of 100?
1 answers ( 0 marked as helpful)
You can save the result of the function into an object and then use the table() function to get the frequency of the heads and tails.
> my.result <- flip()
> table(my.result)
my.result
heads tails
33 67