5.10 For loops
Instead of drawing multiple times from the same distribution, we can write a for loop to repeatedly generate and update the number of individuals with the A
allele.
A for loop allows you to run some code X number of times. For example:
## [1] 1
## [1] 2
## [1] 3
This for loop goes through all the values between 1 and 3, and prints each of them out.
Modify the for loop to instead run our rbinom
command.
## [1] 0.49
## [1] 0.45
## [1] 0.43