Question: What's wrong with my R code? I'm trying to create a simulation for the following question: Using the logistic growth model and your competition coefficients,

What's wrong with my R code? I'm trying to create a simulation for the following question: Using the logistic growth model and your competition coefficients, develop a 40-year simulation in discrete time of the population (start with 60 fish of each type).

competition coefficients are : 0.7220 for species 1 and 0.7245 for species 2

carrying capacity: 1000 for both species

growth rate: 0.6 for species 1 and 0.3 for species 2

time: 40 years

dlvcomp2<-function(N,alphas,rd= c(1, 1 ), K= c(1000,1000)) { N1.t1<-N[1]+r[1] * N[1] * (1-(N[1]+a[1] * N[2]/ K[1]) N2.t1<-N[2]+r[2] * N[2] * (1-(N[2]+a[2] * N[2]/K[1]) c( N1.t1,N2.t1) }

a<-matrix(c(0.7220 , 0.7245),ncol = 2, byrow = TRUE) r<- c(0.6,0.3) k<-c(1000,1000) t<-40 N <- matrix(0, nrow = t + 1, ncol = 2) N[1, ]<- c(60, 60) for( i in 1:t) N[i + 1, ] <- dlvcomp2(N[i, ], a)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!