# NOT RUN {
# Load the 1970-1999 version of the North Sea model supplied with the package, run,
# and generate a plot:
model <- e2e_read("North_Sea", "1970-1999")
results <- e2e_run(model, nyears=2,csv.output=FALSE)
# Plot data annual data
e2e_compare_obs(selection="ANNUAL", model, results=results)
# Note that these are the observational data that were used as the target for optimizing
# the model parameters
# Direct the graphics output to a file ... in this example the graphics file
# is sent to a temporary folder rather than the current working directory:
# or jpeg("plot.jpg"), png("plot.png")
pdf(file.path(tempdir(), "plot.pdf"),width=8,height=6)
e2e_compare_obs(selection="ANNUAL", model, results=results)
dev.off()
# Plot monthly data
dev.new()
e2e_compare_obs(model, selection="MONTHLY",results=results)
# Note that these observational data were NOT used for optimizing the
# model parameters
# }
# NOT RUN {
# To create the same plots from the csv files saved by the e2e_run() function, use:
model <- e2e_read("North_Sea", "1970-1999")
results <- e2e_run(model, nyears=2,csv.output=TRUE)
# Here the csv outputs are saved to a temporary folder since results.path is not
# set in e2e_read()
e2e_compare_obs(selection="ANNUAL", model, use.saved=TRUE)
dev.new()
e2e_compare_obs(selection="MONTHLY", model, use.saved=TRUE)
# }
# NOT RUN {
# Load the 1970-1999 version of the North Sea model supplied with the package and plot
# example data with credible intervals generated by a baseline mode Monte Carlo analysis.
# This example requires the Strathe2E2examples supplementary data package.
if(require(StrathE2E2examples)){
model <- e2e_read("North_Sea", "1970-1999")
e2e_compare_obs(model, selection="ANNUAL",ci.data=TRUE,use.example=TRUE)
dev.new()
e2e_compare_obs(selection="MONTHLY", model, ci.data=TRUE,use.example=TRUE)
}
# }
Run the code above in your browser using DataLab