Skip to content

Commit

Permalink
Default "ML" type in plot.MLZ_data
Browse files Browse the repository at this point in the history
  • Loading branch information
Quang C. Huynh committed Sep 20, 2019
1 parent 94e2ba4 commit b23460b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Title: Mean Length-Based Estimators of Mortality using TMB
Version: 0.1.3
Authors@R: c(person("Quang", "Huynh", email = "q.huynh@oceans.ubc.ca", role = c("aut", "cre")),
person("Todd", "Gedamke", rol = "ctb"), person("Amy", "Then", rol = "ctb"))
Date: 2019-09-20
Maintainer: Quang Huynh <q.huynh@oceans.ubc.ca>
Description: Estimation functions and diagnostic tools for mean length-based total mortality estimators based on Gedamke and Hoenig (2006) <doi:10.1577/T05-153.1>.
Depends:
Expand All @@ -28,7 +29,6 @@ Suggests:
VignetteBuilder: knitr
LinkingTo: TMB, RcppEigen
NeedsCompilation: yes
Packaged: 2017-03-01 18:29:13 UTC; qhuynh
Author: Quang Huynh [aut, cre],
Todd Gedamke [ctb],
Amy Then [ctb]
4 changes: 2 additions & 2 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ setMethod("summary", signature(object = "MLZ_model"), function(object)
#' }
#' @aliases plot.MLZ_data
#' @export
setMethod("plot", signature(x = "MLZ_data"), function(x, type = c("comp", "ML"), ggplot_layer = NULL) {
setMethod("plot", signature(x = "MLZ_data"), function(x, type = c("ML", "comp"), ggplot_layer = NULL) {
type <- match.arg(type)
MLZ_data <- x

Expand Down Expand Up @@ -222,7 +222,7 @@ setMethod("plot", signature(x = "MLZ_data"), function(x, type = c("comp", "ML"),
xlab = "Year", ylab = "CPUE")
if("Effort" %in% names(summary.MLZ)) plot(Effort ~ Year, data = summary.MLZ, pch = 16, typ = "o",
xlab = "Year", ylab = "Effort")
} else stop("No mean lengths available.")
} else stop("No mean lengths available. Try plot(", substitute(x), ", type = \"comp\")")
}

return(invisible())
Expand Down
2 changes: 1 addition & 1 deletion man/plot-MLZ_data-method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/MLZ.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bin_length(SilkSnapper)

The `plot` function can be used to visualize the data to aid in the selection of $L_c$.
```{r, fig.height = 5, fig.width = 6, message = FALSE}
plot(new.dataset)
plot(new.dataset, type = "comp")
```

Once Lc is identified, `calc_ML()` can be used to mean lengths from records larger than Lc.
Expand Down

0 comments on commit b23460b

Please sign in to comment.