From 0f467d0a90e478cbd35e611731b13d0dccba4a34 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Fri, 6 Oct 2023 20:12:56 +0200 Subject: [PATCH] execute `contr()` example in R CMD check closes #461 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/contrs.R | 7 ++++--- man/contr.deviation.Rd | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0862fb69..1da935c42 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: datawizard Title: Easy Data Wrangling and Statistical Transformations -Version: 0.9.0 +Version: 0.9.0.1 Authors@R: c( person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = "aut", comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@patilindrajeets")), diff --git a/NEWS.md b/NEWS.md index a1137ff24..4e88f6690 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# datawizard 0.9.0.9000 (development version) + # datawizard 0.9.0 NEW FUNCTIONS diff --git a/R/contrs.R b/R/contrs.R index 2e5638cea..4de5a3582 100644 --- a/R/contrs.R +++ b/R/contrs.R @@ -32,8 +32,8 @@ #' #' @seealso [stats::contr.sum()] #' -#' @examples -#' if (FALSE) { +#' @examplesIf !identical(Sys.getenv("IN_PKGDOWN"), "true") +#' \donttest{ #' data("mtcars") #' #' mtcars <- data_modify(mtcars, cyl = factor(cyl)) @@ -83,7 +83,8 @@ #' } #' #' @export -contr.deviation <- function(n, base = 1, +contr.deviation <- function(n, + base = 1, contrasts = TRUE, sparse = FALSE) { cont <- stats::contr.treatment(n, diff --git a/man/contr.deviation.Rd b/man/contr.deviation.Rd index fd5de7a4b..07ca22814 100644 --- a/man/contr.deviation.Rd +++ b/man/contr.deviation.Rd @@ -49,7 +49,8 @@ the differences the \strong{A} and \strong{B} group means from the overall mean, respectively. } \examples{ -if (FALSE) { +\dontshow{if (!identical(Sys.getenv("IN_PKGDOWN"), "true")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +\donttest{ data("mtcars") mtcars <- data_modify(mtcars, cyl = factor(cyl)) @@ -97,7 +98,7 @@ if (FALSE) { #> cyl6:am1 1.000 -1.000 -1.000 1.000 0.000 0.000 #> cyl8:am1 1.000 -1.000 0.000 0.000 -1.000 1.000 } - +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[stats:contrast]{stats::contr.sum()}}