I am a beginner at R and I'm trying to loop some binomial random samples to record a function of those random samples and then graph them.
I tried the following code. I know it's wrong but I don't know how to make it work.
for (i:10){
a = (rbinom(1,20,0.2))
b= 20 - a
c = (rbinom(1,50,0.3))
d = 50 - c
fi = a*b*c*d
i = i +1
x <- list(fi)
}