From 8e68eec70b2994738bfc0540d8df6924cc05b298 Mon Sep 17 00:00:00 2001 From: Flavjack Date: Thu, 31 Mar 2022 18:44:52 -0500 Subject: [PATCH] fix cran comments --- CRAN-SUBMISSION | 3 +++ NEWS.md | 1 + R/plot_diag.R | 6 ++++-- R/utils.R | 4 ---- man/plot_diag.Rd | 2 ++ 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION new file mode 100644 index 00000000..3ca99ab5 --- /dev/null +++ b/CRAN-SUBMISSION @@ -0,0 +1,3 @@ +Version: 0.5.5 +Date: 2022-03-31 18:40:25 UTC +SHA: 392ba4c3331d77d731a4429853f30f06083f11bd diff --git a/NEWS.md b/NEWS.md index dd5a341b..81aaaf04 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ - Tarpuy: select sheet for field-book sketch - Tarpuy: create field-book only with the factor list - Tarpuy: column with [] are omitted in the field-book generation +- CRAN comments: if (class(model) == "lmerMod") => if ( is(model, "lmerMod") # inti 0.5.4 diff --git a/R/plot_diag.R b/R/plot_diag.R index e6233c95..8e807454 100644 --- a/R/plot_diag.R +++ b/R/plot_diag.R @@ -17,6 +17,8 @@ #' #' lm <- aov(stemdw ~ bloque + geno*treat, dt) #' +#' #lm <- lme4::lmer(stemdw ~ bloque + (1|geno:treat), dt) +#' #' plot(lm, which = 1) #' plot_diag(lm)[3] #' @@ -38,11 +40,11 @@ plot_diag <- function( model, title = NA) { title <- if(is.null(title) || is.na(title) ) {""} else {title} - dt <- if ( class(model) == "lm" || class(model) == "aov" ) { + dt <- if ( inherits(model, "lm") || inherits(model, "aov") ) { ggplot2::fortify(model) - } else if ( class(model) == "lmerMod" ) { + } else if ( inherits(model, "lmerMod") ) { lme4::fortify.merMod(model) diff --git a/R/utils.R b/R/utils.R index 50380c25..0b1e000b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -4,7 +4,3 @@ utils::globalVariables(c(".", ":=", "%>%")) #' @export dplyr::`%>%` - - - - diff --git a/man/plot_diag.Rd b/man/plot_diag.Rd index c17ea674..80923a2b 100644 --- a/man/plot_diag.Rd +++ b/man/plot_diag.Rd @@ -25,6 +25,8 @@ dt <- potato lm <- aov(stemdw ~ bloque + geno*treat, dt) +#lm <- lme4::lmer(stemdw ~ bloque + (1|geno:treat), dt) + plot(lm, which = 1) plot_diag(lm)[3]