Question: 4. Suppose you are attempting to write a program in R that will allow you to predict population values over the next 25 years for
4. Suppose you are attempting to write a program in R that will allow you to predict population values over the next 25 years for a particular species exhibiting Malthusian growth. You have observed that r=0.05, and the current population consists of 1000 individuals. You write the following program, and attempt to run it in R. The graph thats generated doesnt appear to show Malthusian growth, and in addition R gives you a warning message. Identify the problem in the code.
r<-0.05
Year<-2015
Pop<-1000
Pops<-c()
Years<-c()
for (i in 1:25){
Pops[i]<-Pop
Years[i]<-Year
Pop<-Pops+r*Pop
Year<-Year+1 }
plot(Pops~Years)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
