From c4f3f29b0b8c5ef9016eca93328d46231eb62ff2 Mon Sep 17 00:00:00 2001 From: Etienne Bacher <52219252+etiennebacher@users.noreply.github.com> Date: Sun, 6 Oct 2024 12:45:13 +0200 Subject: [PATCH] Release 0.13.0 (#546) * Increment version number to 0.13.0 * fix description, remove othe cran comments * remove deprecated functions and arguments * forgot to remove one arg * styler * update news * update news * add correct snapshot test * requires insight 0.20.5 --------- Co-authored-by: etiennebacher Co-authored-by: Daniel --- DESCRIPTION | 5 +-- NAMESPACE | 4 -- NEWS.md | 16 +++++++- R/data_partition.R | 8 ---- R/data_select.R | 22 ---------- R/demean.R | 19 +-------- R/descriptives.R | 9 +--- R/extract_column_names.R | 24 +---------- R/mean_sd.R | 14 +------ R/means_by_group.R | 15 ------- R/recode_values.R | 32 --------------- R/rescale_weights.R | 9 +--- R/skewness_kurtosis.R | 64 ----------------------------- R/text_format.R | 9 ---- cran-comments.md | 7 ---- man/coef_var.Rd | 3 -- man/data_partition.Rd | 3 -- man/demean.Rd | 11 ++--- man/extract_column_names.Rd | 22 ---------- man/mean_sd.Rd | 5 +-- man/means_by_group.Rd | 13 +----- man/recode_values.Rd | 15 ------- man/rescale_weights.Rd | 4 +- man/skewness.Rd | 4 -- man/text_format.Rd | 10 ----- tests/testthat/_snaps/categorize.md | 19 ++++----- tests/testthat/test-categorize.R | 2 +- tests/testthat/test-coef_var.R | 4 -- tests/testthat/test-mean_sd.R | 5 --- 29 files changed, 40 insertions(+), 337 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3d1a0081a..f3e7599af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: datawizard Title: Easy Data Wrangling and Statistical Transformations -Version: 0.12.3.4 +Version: 0.13.0 Authors@R: c( person("Indrajeet", "Patil", , "patilindrajeet.science@gmail.com", role = "aut", comment = c(ORCID = "0000-0003-1995-6531")), @@ -33,7 +33,7 @@ BugReports: https://github.com/easystats/datawizard/issues Depends: R (>= 3.6) Imports: - insight (>= 0.20.4), + insight (>= 0.20.5), stats, utils Suggests: @@ -76,4 +76,3 @@ RoxygenNote: 7.3.2 Config/testthat/edition: 3 Config/testthat/parallel: true Config/Needs/website: easystats/easystatstemplate -Remotes: easystats/insight diff --git a/NAMESPACE b/NAMESPACE index a08798db1..c435c0cc5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -220,7 +220,6 @@ export(assign_labels) export(categorize) export(center) export(centre) -export(change_code) export(change_scale) export(coef_var) export(coerce_to_numeric) @@ -237,7 +236,6 @@ export(data_codebook) export(data_duplicated) export(data_extract) export(data_filter) -export(data_find) export(data_group) export(data_join) export(data_match) @@ -276,8 +274,6 @@ export(empty_columns) export(empty_rows) export(extract_column_names) export(find_columns) -export(format_text) -export(get_columns) export(kurtosis) export(labels_to_levels) export(mean_sd) diff --git a/NEWS.md b/NEWS.md index 8e329b0fb..f2ade5883 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,16 +1,30 @@ -# datawizard (development) +# datawizard 0.13.0 BREAKING CHANGES * `data_rename()` now errors when the `replacement` argument contains `NA` values or empty strings (#539). +* Removed deprecated functions `get_columns()`, `data_find()`, `format_text()` (#546). + +* Removed deprecated arguments `group` and `na.rm` in multiple functions. Use `by` and `remove_na` instead (#546). + +* The default value for the argument `dummy_factors` in `to_numeric()` has + changed from `TRUE` to `FALSE` (#544). + CHANGES * The `pattern` argument in `data_rename()` can also be a named vector. In this case, names are used as values for the `replacement` argument (i.e. `pattern` can be a character vector using ` = ""`). +* `categorize()` gains a new `breaks` argument, to decide whether breaks are + inclusive or exclusive (#548). + +* The `labels` argument in `categorize()` gets two new options, `"range"` and + `"observed"`, to use the range of categorized values as labels (i.e. factor + levels) (#548). + * Minor additions to `reshape_ci()` to work with forthcoming changes in the `{bayestestR}` package. diff --git a/R/data_partition.R b/R/data_partition.R index 09add9dd7..99f481e18 100644 --- a/R/data_partition.R +++ b/R/data_partition.R @@ -15,7 +15,6 @@ #' @param row_id Character string, indicating the name of the column that #' contains the row-id's. #' @param verbose Toggle messages and warnings. -#' @param group Deprecated. Use `by` instead. #' #' @return A list of data frames. The list includes one training set per given #' proportion and the remaining data as test set. List elements of training @@ -50,17 +49,10 @@ data_partition <- function(data, seed = NULL, row_id = ".row_id", verbose = TRUE, - group = NULL, ...) { # validation checks data <- .coerce_to_dataframe(data) - ## TODO: remove warning in future release - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - if (sum(proportion) > 1) { insight::format_error("Sum of `proportion` cannot be higher than 1.") } diff --git a/R/data_select.R b/R/data_select.R index 0f62ba398..db91fc06b 100644 --- a/R/data_select.R +++ b/R/data_select.R @@ -38,25 +38,3 @@ data_select <- function(data, out <- .replace_attrs(out, a) out } - - -#' @rdname extract_column_names -#' @export -get_columns <- function(data, - select = NULL, - exclude = NULL, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ...) { - insight::format_warning("Function `get_columns()` is deprecated and will be removed in a future release. Please use `data_select()` instead.") # nolint - data_select( - data, - select = select, - exclude = exclude, - ignore_case = ignore_case, - regex = regex, - verbose = verbose, - ... - ) -} diff --git a/R/demean.R b/R/demean.R index 94bfc255f..b5363edb6 100644 --- a/R/demean.R +++ b/R/demean.R @@ -43,7 +43,6 @@ #' attributes to indicate the within- and between-effects. This is only #' relevant when printing `model_parameters()` - in such cases, the #' within- and between-effects are printed in separated blocks. -#' @param group Deprecated. Use `by` instead. #' @inheritParams center #' #' @return @@ -285,14 +284,7 @@ demean <- function(x, suffix_demean = "_within", suffix_groupmean = "_between", add_attributes = TRUE, - verbose = TRUE, - group = NULL) { - ## TODO: remove warning in future release - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - + verbose = TRUE) { degroup( x = x, select = select, @@ -317,14 +309,7 @@ degroup <- function(x, suffix_demean = "_within", suffix_groupmean = "_between", add_attributes = TRUE, - verbose = TRUE, - group = NULL) { - ## TODO: remove warning later - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - + verbose = TRUE) { # ugly tibbles again... x <- .coerce_to_dataframe(x) diff --git a/R/descriptives.R b/R/descriptives.R index 097934d29..43479f697 100644 --- a/R/descriptives.R +++ b/R/descriptives.R @@ -77,7 +77,6 @@ coef_var.default <- function(x, verbose = TRUE, ...) { #' as the nearest endpoint. #' @param remove_na Logical. Should `NA` values be removed before computing (`TRUE`) #' or not (`FALSE`, default)? -#' @param na.rm Deprecated. Please use `remove_na` instead. #' @param n If `method = "unbiased"` and both `mu` and `sigma` are provided (not #' computed from `x`), what sample size to use to adjust the computed CV #' for small-sample bias? @@ -111,13 +110,7 @@ coef_var.default <- function(x, verbose = TRUE, ...) { #' @export coef_var.numeric <- function(x, mu = NULL, sigma = NULL, method = c("standard", "unbiased", "median_mad", "qcd"), - trim = 0, remove_na = FALSE, n = NULL, na.rm = FALSE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - insight::format_warning("Argument `na.rm` is deprecated. Please use `remove_na` instead.") - remove_na <- na.rm - } - + trim = 0, remove_na = FALSE, n = NULL, ...) { # TODO: Support weights if (!missing(x) && all(c(-1, 1) %in% sign(x))) { insight::format_error("Coefficient of variation only applicable for ratio scale variables.") diff --git a/R/extract_column_names.R b/R/extract_column_names.R index b89173a8c..c245f4bab 100644 --- a/R/extract_column_names.R +++ b/R/extract_column_names.R @@ -160,28 +160,6 @@ extract_column_names <- function(data, columns } - -#' @rdname extract_column_names -#' @export -data_find <- function(data, - select = NULL, - exclude = NULL, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ...) { - insight::format_warning("Function `data_find()` is deprecated and will be removed in a future release. Please use `extract_column_names()` instead.") # nolint - extract_column_names( - data, - select = select, - exclude = exclude, - ignore_case = ignore_case, - regex = regex, - verbose = verbose, - ... - ) -} - #' @rdname extract_column_names #' @export -find_columns <- data_find +find_columns <- extract_column_names diff --git a/R/mean_sd.R b/R/mean_sd.R index d18473d8d..42ce9b523 100644 --- a/R/mean_sd.R +++ b/R/mean_sd.R @@ -20,23 +20,13 @@ #' median_mad(mtcars$mpg) #' #' @export -mean_sd <- function(x, times = 1L, remove_na = TRUE, named = TRUE, na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - insight::format_warning("Argument `na.rm` is deprecated. Please use `remove_na` instead.") - remove_na <- na.rm - } +mean_sd <- function(x, times = 1L, remove_na = TRUE, named = TRUE, ...) { .centrality_dispersion(x, type = "mean", times = times, remove_na = remove_na, named = named) } #' @export #' @rdname mean_sd -median_mad <- function(x, times = 1L, remove_na = TRUE, constant = 1.4826, named = TRUE, na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - insight::format_warning("Argument `na.rm` is deprecated. Please use `remove_na` instead.") - remove_na <- na.rm - } +median_mad <- function(x, times = 1L, remove_na = TRUE, constant = 1.4826, named = TRUE, ...) { .centrality_dispersion(x, type = "median", times = times, remove_na = remove_na, constant = constant, named = named) } diff --git a/R/means_by_group.R b/R/means_by_group.R index ad188f275..39416bb11 100644 --- a/R/means_by_group.R +++ b/R/means_by_group.R @@ -19,7 +19,6 @@ #' @param digits Optional scalar, indicating the amount of digits after decimal #' point when rounding estimates and values. #' @param ... Currently not used -#' @param group Deprecated. Use `by` instead. #' @inheritParams find_columns #' #' @return A data frame with information on mean and further summary statistics @@ -60,14 +59,7 @@ means_by_group.numeric <- function(x, ci = 0.95, weights = NULL, digits = NULL, - group = NULL, ...) { - ## TODO: remove warning in future release - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - # validation check for arguments # "by" must be provided @@ -139,14 +131,7 @@ means_by_group.data.frame <- function(x, ignore_case = FALSE, regex = FALSE, verbose = TRUE, - group = NULL, ...) { - ## TODO: remove warning in future release - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - # evaluate select/exclude, may be select-helpers select <- .select_nse(select, x, diff --git a/R/recode_values.R b/R/recode_values.R index b4570bf44..a8e8d6d3b 100644 --- a/R/recode_values.R +++ b/R/recode_values.R @@ -527,35 +527,3 @@ recode_values.data.frame <- function(x, ok } - - -## TODO Deprecate and remove alias later - -#' @rdname recode_values -#' @export -change_code <- function(x, - select = NULL, - exclude = NULL, - recode = NULL, - default = NULL, - preserve_na = TRUE, - append = FALSE, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ...) { - insight::format_warning("Function `change_code()` is deprecated. Please use `recode_values()` instead.") # nolint - recode_values( - x, - select = select, - exclude = exclude, - recode = recode, - default = default, - preserve_na = preserve_na, - append = append, - ignore_case = ignore_case, - regex = regex, - verbose = verbose, - ... - ) -} diff --git a/R/rescale_weights.R b/R/rescale_weights.R index 02aab1d2e..60d405c9d 100644 --- a/R/rescale_weights.R +++ b/R/rescale_weights.R @@ -20,7 +20,6 @@ #' @param nest Logical, if `TRUE` and `by` indicates at least two #' group variables, then groups are "nested", i.e. groups are now a #' combination from each group level of the variables in `by`. -#' @param group Deprecated. Use `by` instead. #' #' @return `data`, including the new weighting variables: `pweights_a` #' and `pweights_b`, which represent the rescaled design weights to use @@ -88,13 +87,7 @@ #' ) #' } #' @export -rescale_weights <- function(data, by, probability_weights, nest = FALSE, group = NULL) { - ## TODO: remove warning in future release - if (!is.null(group)) { - by <- group - insight::format_warning("Argument `group` is deprecated and will be removed in a future release. Please use `by` instead.") # nolint - } - +rescale_weights <- function(data, by, probability_weights, nest = FALSE) { if (inherits(by, "formula")) { by <- all.vars(by) } diff --git a/R/skewness_kurtosis.R b/R/skewness_kurtosis.R index 6142c59ad..23ced0a04 100644 --- a/R/skewness_kurtosis.R +++ b/R/skewness_kurtosis.R @@ -110,15 +110,7 @@ skewness.numeric <- function(x, type = "2", iterations = NULL, verbose = TRUE, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - if (remove_na) x <- x[!is.na(x)] n <- length(x) out <- (sum((x - mean(x))^3) / n) / (sum((x - mean(x))^2) / n)^1.5 @@ -177,15 +169,7 @@ skewness.matrix <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - .skewness <- apply( x, 2, @@ -213,15 +197,7 @@ skewness.data.frame <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - .skewness <- lapply(x, skewness, remove_na = remove_na, @@ -241,15 +217,7 @@ skewness.default <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - skewness( .factor_to_numeric(x), remove_na = remove_na, @@ -277,15 +245,7 @@ kurtosis.numeric <- function(x, type = "2", iterations = NULL, verbose = TRUE, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - if (remove_na) x <- x[!is.na(x)] n <- length(x) out <- n * sum((x - mean(x))^4) / (sum((x - mean(x))^2)^2) @@ -342,15 +302,7 @@ kurtosis.matrix <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - .kurtosis <- apply( x, 2, @@ -374,15 +326,7 @@ kurtosis.data.frame <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - .kurtosis <- lapply(x, kurtosis, remove_na = remove_na, @@ -400,15 +344,7 @@ kurtosis.default <- function(x, remove_na = TRUE, type = "2", iterations = NULL, - na.rm = TRUE, ...) { - # TODO: remove deprecated argument later - if (!missing(na.rm)) { - # TODO: add deprecation warning in a later update - insight::format_warning("Argument `na.rm` is deprecated and will be removed in a future release. Please use `remove_na` instead.") # nolint - remove_na <- na.rm - } - kurtosis( .factor_to_numeric(x), remove_na = remove_na, diff --git a/R/text_format.R b/R/text_format.R index afdf4f861..0fa75bcac 100644 --- a/R/text_format.R +++ b/R/text_format.R @@ -42,15 +42,6 @@ text_format <- function(text, sep = ", ", last = " and ", width = NULL, enclose text_wrap(text_concatenate(text, sep = sep, last = last, enclose = enclose), width = width) } -## TODO Deprecate and remove alias later - -#' @rdname text_format -#' @export -format_text <- function(text, sep = ", ", last = " and ", width = NULL, enclose = NULL, ...) { - insight::format_warning("Function `format_text()` is deprecated and will be removed in a future release. Please use `text_format()` instead.") # nolint - text_format(text, sep = sep, last = last, width = width, enclose = enclose, ...) -} - #' @rdname text_format #' @export text_fullstop <- function(text) { diff --git a/cran-comments.md b/cran-comments.md index 2c30d1287..095f22e9a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,10 +9,3 @@ We checked 18 reverse dependencies, comparing R CMD check results across CRAN an * We saw 0 new problems * We failed to check 0 packages -## Other comments - -This is a patch release that should (hopefully) fix a failure occurring on macOS -when building vignettes. This only happens on macOS with R 4.3. We tried to -reproduce this locally and in CI with the same setup, but we couldn't. Hence, we -removed all vignettes (except for one "Overview"), they are now only available -on the website. diff --git a/man/coef_var.Rd b/man/coef_var.Rd index 92274ca59..2ff973838 100644 --- a/man/coef_var.Rd +++ b/man/coef_var.Rd @@ -19,7 +19,6 @@ distribution_coef_var(x, ...) trim = 0, remove_na = FALSE, n = NULL, - na.rm = FALSE, ... ) } @@ -52,8 +51,6 @@ or not (\code{FALSE}, default)?} \item{n}{If \code{method = "unbiased"} and both \code{mu} and \code{sigma} are provided (not computed from \code{x}), what sample size to use to adjust the computed CV for small-sample bias?} - -\item{na.rm}{Deprecated. Please use \code{remove_na} instead.} } \value{ The computed coefficient of variation for \code{x}. diff --git a/man/data_partition.Rd b/man/data_partition.Rd index 68ac05a19..1150b4f28 100644 --- a/man/data_partition.Rd +++ b/man/data_partition.Rd @@ -11,7 +11,6 @@ data_partition( seed = NULL, row_id = ".row_id", verbose = TRUE, - group = NULL, ... ) } @@ -33,8 +32,6 @@ contains the row-id's.} \item{verbose}{Toggle messages and warnings.} -\item{group}{Deprecated. Use \code{by} instead.} - \item{...}{Other arguments passed to or from other functions.} } \value{ diff --git a/man/demean.Rd b/man/demean.Rd index 8a9a49308..fb4db3a29 100644 --- a/man/demean.Rd +++ b/man/demean.Rd @@ -14,8 +14,7 @@ demean( suffix_demean = "_within", suffix_groupmean = "_between", add_attributes = TRUE, - verbose = TRUE, - group = NULL + verbose = TRUE ) degroup( @@ -27,8 +26,7 @@ degroup( suffix_demean = "_within", suffix_groupmean = "_between", add_attributes = TRUE, - verbose = TRUE, - group = NULL + verbose = TRUE ) detrend( @@ -40,8 +38,7 @@ detrend( suffix_demean = "_within", suffix_groupmean = "_between", add_attributes = TRUE, - verbose = TRUE, - group = NULL + verbose = TRUE ) } \arguments{ @@ -86,8 +83,6 @@ within- and between-effects are printed in separated blocks.} \item{verbose}{Toggle warnings and messages.} -\item{group}{Deprecated. Use \code{by} instead.} - \item{center}{Method for centering. \code{demean()} always performs mean-centering, while \code{degroup()} can use \code{center = "median"} or \code{center = "mode"} for median- or mode-centering, and also \code{"min"} diff --git a/man/extract_column_names.Rd b/man/extract_column_names.Rd index 6805d9569..6e658ab33 100644 --- a/man/extract_column_names.Rd +++ b/man/extract_column_names.Rd @@ -2,9 +2,7 @@ % Please edit documentation in R/data_select.R, R/extract_column_names.R \name{data_select} \alias{data_select} -\alias{get_columns} \alias{extract_column_names} -\alias{data_find} \alias{find_columns} \title{Find or get columns in a data frame based on search patterns} \usage{ @@ -18,16 +16,6 @@ data_select( ... ) -get_columns( - data, - select = NULL, - exclude = NULL, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ... -) - extract_column_names( data, select = NULL, @@ -38,16 +26,6 @@ extract_column_names( ... ) -data_find( - data, - select = NULL, - exclude = NULL, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ... -) - find_columns( data, select = NULL, diff --git a/man/mean_sd.Rd b/man/mean_sd.Rd index f0ea239f8..33eeb4bc5 100644 --- a/man/mean_sd.Rd +++ b/man/mean_sd.Rd @@ -5,7 +5,7 @@ \alias{median_mad} \title{Summary Helpers} \usage{ -mean_sd(x, times = 1L, remove_na = TRUE, named = TRUE, na.rm = TRUE, ...) +mean_sd(x, times = 1L, remove_na = TRUE, named = TRUE, ...) median_mad( x, @@ -13,7 +13,6 @@ median_mad( remove_na = TRUE, constant = 1.4826, named = TRUE, - na.rm = TRUE, ... ) } @@ -29,8 +28,6 @@ or not (\code{FALSE}, default)?} \item{named}{Should the vector be named? (E.g., \code{c("-SD" = -1, Mean = 1, "+SD" = 2)}.)} -\item{na.rm}{Deprecated. Please use \code{remove_na} instead.} - \item{...}{Not used.} \item{constant}{scale factor.} diff --git a/man/means_by_group.Rd b/man/means_by_group.Rd index d7a6dfc96..ba2a7d0c8 100644 --- a/man/means_by_group.Rd +++ b/man/means_by_group.Rd @@ -8,15 +8,7 @@ \usage{ means_by_group(x, ...) -\method{means_by_group}{numeric}( - x, - by = NULL, - ci = 0.95, - weights = NULL, - digits = NULL, - group = NULL, - ... -) +\method{means_by_group}{numeric}(x, by = NULL, ci = 0.95, weights = NULL, digits = NULL, ...) \method{means_by_group}{data.frame}( x, @@ -29,7 +21,6 @@ means_by_group(x, ...) ignore_case = FALSE, regex = FALSE, verbose = TRUE, - group = NULL, ... ) } @@ -56,8 +47,6 @@ weights are used.} \item{digits}{Optional scalar, indicating the amount of digits after decimal point when rounding estimates and values.} -\item{group}{Deprecated. Use \code{by} instead.} - \item{select}{Variables that will be included when performing the required tasks. Can be either \itemize{ diff --git a/man/recode_values.Rd b/man/recode_values.Rd index 9810c0a2d..baa7afda9 100644 --- a/man/recode_values.Rd +++ b/man/recode_values.Rd @@ -4,7 +4,6 @@ \alias{recode_values} \alias{recode_values.numeric} \alias{recode_values.data.frame} -\alias{change_code} \title{Recode old values of variables into new values} \usage{ recode_values(x, ...) @@ -31,20 +30,6 @@ recode_values(x, ...) verbose = TRUE, ... ) - -change_code( - x, - select = NULL, - exclude = NULL, - recode = NULL, - default = NULL, - preserve_na = TRUE, - append = FALSE, - ignore_case = FALSE, - regex = FALSE, - verbose = TRUE, - ... -) } \arguments{ \item{x}{A data frame, numeric or character vector, or factor.} diff --git a/man/rescale_weights.Rd b/man/rescale_weights.Rd index 4a67d4100..d9651decb 100644 --- a/man/rescale_weights.Rd +++ b/man/rescale_weights.Rd @@ -4,7 +4,7 @@ \alias{rescale_weights} \title{Rescale design weights for multilevel analysis} \usage{ -rescale_weights(data, by, probability_weights, nest = FALSE, group = NULL) +rescale_weights(data, by, probability_weights, nest = FALSE) } \arguments{ \item{data}{A data frame.} @@ -21,8 +21,6 @@ sampling) weights of the survey data (level-1-weight).} \item{nest}{Logical, if \code{TRUE} and \code{by} indicates at least two group variables, then groups are "nested", i.e. groups are now a combination from each group level of the variables in \code{by}.} - -\item{group}{Deprecated. Use \code{by} instead.} } \value{ \code{data}, including the new weighting variables: \code{pweights_a} diff --git a/man/skewness.Rd b/man/skewness.Rd index a89d98067..0401e3a40 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -19,7 +19,6 @@ skewness(x, ...) type = "2", iterations = NULL, verbose = TRUE, - na.rm = TRUE, ... ) @@ -31,7 +30,6 @@ kurtosis(x, ...) type = "2", iterations = NULL, verbose = TRUE, - na.rm = TRUE, ... ) @@ -61,8 +59,6 @@ errors. If \code{NULL} (default), parametric standard errors are computed.} \item{verbose}{Toggle warnings and messages.} -\item{na.rm}{Deprecated. Please use \code{remove_na} instead.} - \item{digits}{Number of decimal places.} \item{test}{Logical, if \code{TRUE}, tests if skewness or kurtosis is diff --git a/man/text_format.Rd b/man/text_format.Rd index 5f246731f..14d64b096 100644 --- a/man/text_format.Rd +++ b/man/text_format.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/text_format.R \name{text_format} \alias{text_format} -\alias{format_text} \alias{text_fullstop} \alias{text_lastchar} \alias{text_concatenate} @@ -20,15 +19,6 @@ text_format( ... ) -format_text( - text, - sep = ", ", - last = " and ", - width = NULL, - enclose = NULL, - ... -) - text_fullstop(text) text_lastchar(text, n = 1) diff --git a/tests/testthat/_snaps/categorize.md b/tests/testthat/_snaps/categorize.md index d08c14c4d..9ed3c1115 100644 --- a/tests/testthat/_snaps/categorize.md +++ b/tests/testthat/_snaps/categorize.md @@ -31,17 +31,16 @@ [31] (10.4-15) (21-24.4) Levels: (10.4-15) (15.2-19.7) (21-24.4) (26-27.3) (30.4-33.9) ---- +# categorize breaks Code - categorize(mtcars$mpg, "equal_length", n_groups = 5, labels = "observed", - breaks = "inclusive") + categorize(mtcars$mpg, "equal_length", n_groups = 5, labels = "range", breaks = "inclusive") Output - [1] (21-24.4) (21-24.4) (21-24.4) (21-24.4) (15.2-19.7) (15.2-19.7) - [7] (10.4-15) (21-24.4) (21-24.4) (15.2-19.7) (15.2-19.7) (15.2-19.7) - [13] (15.2-19.7) (15.2-19.7) (10.4-15) (10.4-15) (10.4-15) (30.4-33.9) - [19] (30.4-33.9) (30.4-33.9) (21-24.4) (15.2-19.7) (15.2-19.7) (10.4-15) - [25] (15.2-19.7) (26-27.3) (26-27.3) (30.4-33.9) (15.2-19.7) (15.2-19.7) - [31] (10.4-15) (21-24.4) - Levels: (10.4-15) (15.2-19.7) (21-24.4) (26-27.3) (30.4-33.9) + [1] (19.8,24.5] (19.8,24.5] (19.8,24.5] (19.8,24.5] (15.1,19.8] (15.1,19.8] + [7] [10.4,15.1] (19.8,24.5] (19.8,24.5] (15.1,19.8] (15.1,19.8] (15.1,19.8] + [13] (15.1,19.8] (15.1,19.8] [10.4,15.1] [10.4,15.1] [10.4,15.1] (29.2,33.9] + [19] (29.2,33.9] (29.2,33.9] (19.8,24.5] (15.1,19.8] (15.1,19.8] [10.4,15.1] + [25] (15.1,19.8] (24.5,29.2] (24.5,29.2] (29.2,33.9] (15.1,19.8] (15.1,19.8] + [31] [10.4,15.1] (19.8,24.5] + Levels: [10.4,15.1] (15.1,19.8] (19.8,24.5] (24.5,29.2] (29.2,33.9] diff --git a/tests/testthat/test-categorize.R b/tests/testthat/test-categorize.R index 217797893..30453d9ad 100644 --- a/tests/testthat/test-categorize.R +++ b/tests/testthat/test-categorize.R @@ -244,7 +244,7 @@ test_that("categorize labelling ranged", { test_that("categorize breaks", { data(mtcars) - expect_snapshot(categorize(mtcars$mpg, "equal_length", n_groups = 5, labels = "observed", breaks = "inclusive")) + expect_snapshot(categorize(mtcars$mpg, "equal_length", n_groups = 5, labels = "range", breaks = "inclusive")) expect_error( categorize(mtcars$mpg, "equal_length", n_groups = 5, breaks = "something"), regex = "should be one of" diff --git a/tests/testthat/test-coef_var.R b/tests/testthat/test-coef_var.R index a55eb7b96..2ae2275cd 100644 --- a/tests/testthat/test-coef_var.R +++ b/tests/testthat/test-coef_var.R @@ -29,10 +29,6 @@ test_that("coef_var: argument 'remove_na' works", { ) }) -test_that("coef_var: deprecation warning", { - expect_warning(coef_var(c(1:10, NA), na.rm = TRUE)) -}) - test_that("coef_var: method 'unbiased' needs argument 'n' when sigma and mu are provided", { expect_error( coef_var(1:10, method = "unbiased", mu = 10, sigma = 20), diff --git a/tests/testthat/test-mean_sd.R b/tests/testthat/test-mean_sd.R index e0af8a0f1..3e0829fb1 100644 --- a/tests/testthat/test-mean_sd.R +++ b/tests/testthat/test-mean_sd.R @@ -15,8 +15,3 @@ test_that("mean_sd", { expect_equal(unname(diff(msd2)), rep(sd(mtcars[["mpg"]]), 6), tolerance = 0.00001) expect_named(msd2, c("-3 SD", "-2 SD", "-1 SD", "Mean", "+1 SD", "+2 SD", "+3 SD")) }) - -test_that("deprecation warning for `na.rm`", { - expect_warning(mean_sd(c(-1, 0, 1, NA), na.rm = TRUE)) - expect_warning(median_mad(c(-1, 0, 1, 2, 3, NA), na.rm = TRUE)) -})