diff --git a/DESCRIPTION b/DESCRIPTION index 694198e..292a710 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 Description: Estimation functions and diagnostic tools for mean length-based total mortality estimators based on Gedamke and Hoenig (2006) . Depends: @@ -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] diff --git a/R/methods.R b/R/methods.R index 683ade3..d5be0f3 100644 --- a/R/methods.R +++ b/R/methods.R @@ -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 @@ -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()) diff --git a/man/plot-MLZ_data-method.Rd b/man/plot-MLZ_data-method.Rd index 327a988..fd84f46 100644 --- a/man/plot-MLZ_data-method.Rd +++ b/man/plot-MLZ_data-method.Rd @@ -6,7 +6,7 @@ \alias{plot.MLZ_data} \title{\code{plot} method for S4 class \code{MLZ_data}} \usage{ -\S4method{plot}{MLZ_data}(x, type = c("comp", "ML"), +\S4method{plot}{MLZ_data}(x, type = c("ML", "comp"), ggplot_layer = NULL) } \arguments{ diff --git a/vignettes/MLZ.Rmd b/vignettes/MLZ.Rmd index 3c9b2e2..be3dd77 100644 --- a/vignettes/MLZ.Rmd +++ b/vignettes/MLZ.Rmd @@ -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.