Skip to content

Commit

Permalink
Added option to plot removals rather than yield
Browse files Browse the repository at this point in the history
  • Loading branch information
iagomosqueira committed Dec 6, 2024
1 parent b6e6b60 commit ed8d4f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: FLBRP
Title: Reference Points for Fisheries Management
Version: 2.5.9.9050
Version: 2.5.9.9051
Authors@R: c(
person("Iago", "Mosqueira", email = "iago.mosqueira@wur.nl", role = "cre"),
person("Laurence T.", "Kell", email = "laurie@seaplusplus.co.uk", role = "aut"),
Expand Down
12 changes: 10 additions & 2 deletions R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#' @examples
#' data(ple4brp)
#' plot(ple4brp)
#' plot(ple4brp, catch=TRUE)
#' # ADD observations
#' plot(ple4brp, obs=TRUE)
#' # SELECT which refpts to plot
Expand All @@ -42,11 +43,18 @@

setMethod("plot", signature("FLBRP", "missing"),
function(x, refpts=dimnames(x@refpts)$refpt, obs=FALSE, labels=TRUE,
shapes="missing", colours="missing", panels=NULL, ncol=2, ...) {
shapes="missing", colours="missing", panels=NULL, ncol=2,
removals=FALSE, ...) {

# SELECT yield
if(removals)
yield <- 'catch'
else
yield <- 'landings'

# EXTRACT metrics
df <- model.frame(metrics(x,
list(ssb=ssb, harvest=fbar, rec=rec, yield=landings, profit=profit)),
list(ssb=ssb, harvest=fbar, rec=rec, yield=yield, profit=profit)),
drop=FALSE)

# refpts
Expand Down

0 comments on commit ed8d4f7

Please sign in to comment.