### NOT RUN ####
# Generate relevant data, build objects
#dff <- generateDataStoch()
#print(head(dff))
#gr1 <- makeGrowthObj(dff, Formula = sizeNext~size+size2+covariate1)
#sv1 <- makeSurvObj(dff, Formula = surv~size+size2+covariate2)
#fv1 <- makeFecObj(dff, Formula =fec~size+size2,Transform="log")
# Generate time series of covariates for which growth rate is required
# here set to be seasonal environment. NOTE that the order of covariates
# is the same as in dff
#tVals <- seq(1, 20, by = 1/12)
#covTest <- (1 + 0.5*sin(2*pi*tVals))
#covMatTest <- data.frame(covariate1 = rnorm(length(covTest), covTest, 0.5) - 1,
#covariate2 = rnorm(length(covTest),covTest,0.5) - 1,
#covariate3 = rnorm(length(covTest), covTest,0.5) - 1)
#st <- trackPopStructManyCov(covariate = covMatTest, nRunIn = 2*10,
#tMax = length(tVals), growthObj = gr1, survObj = sv1, fecObj = fv1,
#nBigMatrix = 100, minSize = 2*min(dff$size, na.rm = TRUE),
#maxSize = 1.5*max(dff$size, na.rm = TRUE), nMicrosites = 0)
# Function to plot output
#plotResultsStochStruct(tVals = tVals, st = st, covTest = covTest)
Run the code above in your browser using DataLab