Using R, generate data from the Bernoulli(p), for various sample sizes (n= 10, 15, 20, 25, 30, 50, 100, 150, 200), for p = 0.01, 0.4, 0.8
I know how to do it for one case using the rbinom function. Like for the first scenario: rbinom(n=10, size=1, p=0.01).
My aim is to build a function that could compute all these scenarios preventing me to do all of them individually.