From a8fe51d91c613542a74fd3c4f38f7805275ec70e Mon Sep 17 00:00:00 2001 From: dicook Date: Thu, 11 Jul 2024 01:10:31 +1000 Subject: [PATCH] CRAN checks --- DESCRIPTION | 11 ++++------- NEWS.md | 8 +++++--- R/data.r | 26 ++++++++++++++++++++++++++ R/method-model.r | 4 +--- man/null_lm.Rd | 4 +--- 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 31bdc04..a76fc17 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,24 +16,21 @@ URL: http://github.com/dicook/nullabor BugReports: http://github.com/dicook/nullabor/issues Imports: MASS, - rlang, moments, fpc, - tsibble, - forecast, ggplot2, dplyr, purrr, tidyr, tibble, - magrittr, - viridis + magrittr Suggests: - reshape2, + forecast, + viridis, knitr LazyData: true Type: Package LazyLoad: false VignetteBuilder: knitr -RoxygenNote: 7.1.2 +RoxygenNote: 7.3.1 Encoding: UTF-8 diff --git a/NEWS.md b/NEWS.md index aa4409c..a3f3d40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,12 @@ -# nullabor 0.3.9 +# nullabor 0.3.10 -- new theme to remove context from plots -- updated roxygen dependency +- removed dependency on reshape2 +- adjusting other dependencies # nullabor 0.3.9 +- new theme to remove context from plots +- updated roxygen dependency - CRAN fixes, minor code changes # nullabor 0.3.8 diff --git a/R/data.r b/R/data.r index 9b16998..4d30ba3 100644 --- a/R/data.r +++ b/R/data.r @@ -56,3 +56,29 @@ NULL #' @name electoral NULL +#' Tipping data +#' +#' +#' One waiter recorded information about each tip he received over a +#' period of a few months working in one restaurant. He collected several +#' variables: +#' +#' \itemize{ +#' \item tip in dollars, +#' \item bill in dollars, +#' \item sex of the bill payer, +#' \item whether there were smokers in the party, +#' \item day of the week, +#' \item time of day, +#' \item size of the party. +#' } +#' +#' In all he recorded 244 tips. The data was reported in a collection of +#' case studies for business statistics (Bryant & Smith 1995). +#' +#' @references Bryant, P. G. and Smith, M (1995) \emph{Practical Data +#' Analysis: Case Studies in Business Statistics}. Homewood, IL: Richard D. +#' Irwin Publishing: +#' @format A data frame with 244 rows and 7 variables +#' @keywords datasets +"tips" diff --git a/R/method-model.r b/R/method-model.r index 9f51b99..7c6e076 100755 --- a/R/method-model.r +++ b/R/method-model.r @@ -15,15 +15,13 @@ #' @importFrom stats lm predict #' @seealso null_permute, null_dist #' @examples -#' if (requireNamespace('reshape2', quietly = TRUE)) { -#' data("tips", package = "reshape2") +#' data(tips) #' x <- lm(tip ~ total_bill, data = tips) #' tips.reg <- data.frame(tips, .resid = residuals(x), .fitted = fitted(x)) #' library(ggplot2) #' ggplot(lineup(null_lm(tip ~ total_bill, method = 'rotate'), tips.reg)) + #' geom_point(aes(x = total_bill, y = .resid)) + #' facet_wrap(~ .sample) -#' } null_lm <- function(f, method = "rotate", ...) { n <- NULL if (is.character(method)) { diff --git a/man/null_lm.Rd b/man/null_lm.Rd index eeeaad7..7dabde1 100644 --- a/man/null_lm.Rd +++ b/man/null_lm.Rd @@ -23,8 +23,7 @@ a function that given \code{data} generates a null data set. Null hypothesis: variable is linear combination of predictors } \examples{ -if (requireNamespace('reshape2', quietly = TRUE)) { -data("tips", package = "reshape2") +data(tips) x <- lm(tip ~ total_bill, data = tips) tips.reg <- data.frame(tips, .resid = residuals(x), .fitted = fitted(x)) library(ggplot2) @@ -32,7 +31,6 @@ ggplot(lineup(null_lm(tip ~ total_bill, method = 'rotate'), tips.reg)) + geom_point(aes(x = total_bill, y = .resid)) + facet_wrap(~ .sample) } -} \seealso{ null_permute, null_dist }