# NOT RUN {
# Load the 1970-1999 version of the North Sea model supplied with the package and
# generate a yield data object:
# WARNING - this example will take several minutes to run even though the model is
# only run for 3 years per step in harvest ratio. A realistic run would require
# at least 50 years per step and take much longer.
model <- e2e_read("North_Sea", "1970-1999")
pfhr=c(0,0.5,0.75,1.0,1.25,1.5,2.0,2.5,3.0)
pf_yield_data <- e2e_run_ycurve(model,selection="PLANKTIV",nyears=3, HRvector=pfhr,
HRfixed=1,csv.output=FALSE)
data <- e2e_plot_ycurve(model,selection="PLANKTIV", results=pf_yield_data,
title="Planktivorous yield with baseline demersal fishing")
# Users can then plot other biomass, landings and discards data in the results
# object by, for example:
par(mfrow=c(2,1))
par(mar=c(3.2,5,2,0.8))
ym<-1.1*max(pf_yield_data$Cetaceanbiom)
plot(pf_yield_data$PlankFishHRmult, pf_yield_data$Cetaceanbiom, ylim=c(0,ym),
type="l",lwd=3,yaxt="n",xaxt="n",ann=FALSE)
abline(v=1,lty="dashed")
axis(side=1,las=1,cex.axis=0.9)
axis(side=2,las=1,cex.axis=0.9)
mtext("Planktiv. fish harvest ratio multiplier",cex=1,side=1,line=2)
mtext("Cetacean biomass",cex=1,side=2,line=3.5)
mtext(bquote("mMN.m"^-2),cex=0.7,side=3,line=-0.05,adj=-0.18)
ym<-1.1*max(pf_yield_data$Cetaceandisc)
plot(pf_yield_data$PlankFishHRmult, pf_yield_data$Cetaceandisc, ylim=c(0,ym),
type="l",lwd=3,yaxt="n",xaxt="n",ann=FALSE)
abline(v=1,lty="dashed")
axis(side=1,las=1,cex.axis=0.9)
axis(side=2,las=1,cex.axis=0.9)
mtext("Planktiv. fish harvest ratio multiplier",cex=1,side=1,line=2)
mtext("Cetacean by-catch",cex=1,side=2,line=3.5)
mtext(bquote("mMN.m"^-2 ~ ".y"^-1),cex=0.7,side=3,line=-0.05,adj=-0.18)
# }
# NOT RUN {
# Using example data generated with selection="PLANKTIV" ...
# Plot example data for one of the North Sea model versions internal to the package
# This example requires the Strathe2E2examples supplementary data package.
if(require(StrathE2E2examples)){
model <- e2e_read("North_Sea", "1970-1999")
pf_yield_data<-e2e_plot_ycurve(model, selection="PLANKTIV", use.example=TRUE)
}
# Using example data generated with selection="DEMERSAL"...
# This example requires the Strathe2E2examples supplementary data package.
if(require(StrathE2E2examples)){
model <- e2e_read("North_Sea", "1970-1999")
df_yield_data<-e2e_plot_ycurve(model, selection="DEMERSAL", use.example=TRUE)
}
# }
Run the code above in your browser using DataLab