How to repeat rbinom() with different size inputs with each draw?
I am attempting to write R code that will draw from a binomial distribution but will repeat for every value in a specified column in a data frame.
I generated a data frame in r such that the first column “Lambda” represents annual population change. I repeated this value 50 times so each row in the data frame represents one year. I created a second column “Truth.Pop” to represent the true population size projected for 50 years assuming initial population size = 50,000.