# NOT RUN {
# Load the 2003-2013 version of the North Sea model supplied with the package:
model <- e2e_read("North_Sea", "2003-2013")
#Run the model and generate the results object, with csv output suppressed
results <- e2e_run(model,nyears=2, csv.output=FALSE)
# Plot the time series of ecology state variable outputs
e2e_plot_ts(model, results, selection="ECO")
# Time series plot of catches in a new window leaving the existing window open
dev.new()
e2e_plot_ts(model, results, selection="CATCH")
#Direct the graphics output to a file (Windows OS)...
# or jpeg("plot.jpg"), png("plot.png")
pdf(file.path(tempdir(), "plot.pdf"),width=8,height=6)
e2e_plot_ts(model, results, selection="ECO")
dev.off()
# }
# NOT RUN {
# Demonstrate transient behaviour in the time-series outputs (run for 10 years).
# Read the North Sea/1970-1999 model and set the identifier for output files to "baseline",
# run the model and plot the full length output
model <- e2e_read("North_Sea", "1970-1999",model.ident="baseline")
results <- e2e_run(model,nyears=10, csv.output=FALSE)
e2e_plot_ts(model, results, selection="ECO")
dev.new()
e2e_plot_ts(model, results, selection="CATCH")
# Create a new scenario version of the North Sea/1970-1999 model by increasing the activity
# rate of gear 1 (pelagic trawls and seines) by a factor of 3
scenario_model <- model
scenario_model$data$fleet.model$gear_mult[1] <- 3
scenario_model$setup$model.ident <- "gear1x3" # Set a new identifier for the outputs
scenario_results <- e2e_run(scenario_model,nyears=10, csv.output=FALSE)
dev.new()
e2e_plot_ts(scenario_model, scenario_results, selection="ECO")
dev.new()
e2e_plot_ts(scenario_model, scenario_results, selection="CATCH")
# }
Run the code above in your browser using DataLab