diff --git a/NAMESPACE b/NAMESPACE index 4f76bcca4..e5acaa392 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -73,6 +73,7 @@ export(view) exportClasses(tbl_df) import(rlang) importFrom(lifecycle,deprecate_soft) +importFrom(lifecycle,deprecate_stop) importFrom(lifecycle,deprecate_warn) importFrom(lifecycle,expect_deprecated) importFrom(magrittr,"%>%") diff --git a/R/add.R b/R/add.R index 755bbe7a6..c7beadf7e 100644 --- a/R/add.R +++ b/R/add.R @@ -45,7 +45,7 @@ add_row <- function(.data, ..., .before = NULL, .after = NULL) { } if (!is.data.frame(.data)) { - deprecate_warn("2.1.1", "add_row(.data = 'must be a data frame')") + deprecate_stop("2.1.1", "add_row(.data = 'must be a data frame')") } if (dots_n(...) == 0L) { @@ -127,14 +127,13 @@ rbind_at <- function(old, new, pos) { add_column <- function(.data, ..., .before = NULL, .after = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal")) { if (!is.data.frame(.data)) { - deprecate_warn("2.1.1", "add_column(.data = 'must be a data frame')") + deprecate_stop("2.1.1", "add_column(.data = 'must be a data frame')") } if (has_length(.data) && (!is_named(.data) || anyDuplicated(names2(.data))) && missing(.name_repair)) { - deprecate_warn("3.0.0", "add_column(.data = 'must have unique names')", + deprecate_stop("3.0.0", "add_column(.data = 'must have unique names')", details = 'Use `.name_repair = "minimal"`.' ) - .name_repair <- "minimal" } df <- tibble(..., .name_repair = .name_repair) diff --git a/R/as_tibble.R b/R/as_tibble.R index e9f7758c1..d84a55848 100644 --- a/R/as_tibble.R +++ b/R/as_tibble.R @@ -70,7 +70,9 @@ as_tibble.data.frame <- function(x, validate = NULL, ..., .rows = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal"), rownames = pkgconfig::get_config("tibble::rownames", NULL)) { - .name_repair <- compat_name_repair(.name_repair, validate, missing(.name_repair)) + if (!is.null(validate)) { + deprecate_stop("2.0.0", "tibble::as_tibble(validate = )", "as_tibble(.name_repair =)") + } old_rownames <- raw_rownames(x) if (is.null(.rows)) { @@ -98,7 +100,9 @@ as_tibble.data.frame <- function(x, validate = NULL, ..., #' @rdname as_tibble as_tibble.list <- function(x, validate = NULL, ..., .rows = NULL, .name_repair = c("check_unique", "unique", "universal", "minimal")) { - .name_repair <- compat_name_repair(.name_repair, validate, missing(.name_repair)) + if (!is.null(validate)) { + deprecate_stop("2.0.0", "tibble::as_tibble(validate = )", "as_tibble(.name_repair =)") + } lst_to_tibble(x, .rows, .name_repair, col_lengths(x)) } @@ -110,25 +114,6 @@ lst_to_tibble <- function(x, .rows, .name_repair, lengths = NULL, call = caller_ recycle_columns(x, .rows, lengths) } -compat_name_repair <- function(.name_repair, validate, .missing_name_repair) { - if (is.null(validate)) return(.name_repair) - - - if (!.missing_name_repair) { - name_repair <- .name_repair - } else if (isTRUE(validate)) { - name_repair <- "check_unique" - } else { - name_repair <- "minimal" - } - - deprecate_soft("2.0.0", "tibble::as_tibble(validate = )", "as_tibble(.name_repair =)", - env = foreign_caller_env() - ) - - name_repair -} - check_valid_cols <- function(x, pos = NULL, call = caller_env()) { names_x <- names2(x) @@ -259,7 +244,7 @@ as_tibble.table <- function(x, `_n` = "n", ..., n = `_n`, .name_repair = "check_ #' @usage \method{as_tibble}{NULL}(x, ...) as_tibble.NULL <- function(x, ...) { if (missing(x)) { - deprecate_soft("3.0.0", "as_tibble(x = 'can\\'t be missing')") + deprecate_stop("3.0.0", "as_tibble(x = 'can\\'t be missing')") } new_tibble(list(), nrow = 0) diff --git a/R/deprecated.R b/R/deprecated.R index 6cdc4554f..ac088bf49 100644 --- a/R/deprecated.R +++ b/R/deprecated.R @@ -33,23 +33,17 @@ tibble_ <- function(xs) { #' @export #' @rdname deprecated data_frame_ <- function(xs) { - deprecate_soft("2.0.0", "data_frame_()", "tibble()", + deprecate_stop("2.0.0", "data_frame_()", "tibble()", details = '`tibble()` supports dynamic dots, see `?"dyn-dots"`.' ) - - xs <- compat_lazy_dots(xs, caller_env()) - tibble(!!!xs) } #' @export #' @rdname deprecated lst_ <- function(xs) { - deprecate_soft("2.0.0", "lst_()", "lst()", + deprecate_stop("2.0.0", "lst_()", "lst()", details = '`lst()` supports dynamic dots, see `?"dyn-dots"`.' ) - - xs <- compat_lazy_dots(xs, caller_env()) - lst(!!!xs) } #' @description @@ -81,9 +75,7 @@ as.tibble <- function(x, ...) { #' @export #' @rdname deprecated frame_data <- function(...) { - deprecate_soft("2.0.0", "frame_data()", "tribble()") - - tribble(...) + deprecate_stop("2.0.0", "frame_data()", "tribble()") } #' Name repair diff --git a/R/new.R b/R/new.R index c2cc308bf..e6b9d1146 100644 --- a/R/new.R +++ b/R/new.R @@ -34,8 +34,7 @@ new_tibble <- function(x, ..., nrow = NULL, class = NULL, subclass = NULL) { # For compatibility with tibble < 2.0.0 if (is.null(class) && !is.null(subclass)) { - deprecate_soft("2.0.0", "tibble::new_tibble(subclass = )", "new_tibble(class = )") - class <- subclass + deprecate_stop("2.0.0", "tibble::new_tibble(subclass = )", "new_tibble(class = )") } #' @section Construction: diff --git a/R/sub.R b/R/sub.R index 502cfcaea..f65d19753 100644 --- a/R/sub.R +++ b/R/sub.R @@ -200,12 +200,10 @@ NULL tbl_subset2 <- function(x, j, j_arg, call = caller_env()) { if (is.matrix(j)) { - deprecate_soft("3.0.0", "tibble::`[[.tbl_df`(j = 'can\\'t be a matrix", + deprecate_stop("3.0.0", "tibble::`[[.tbl_df`(j = 'can\\'t be a matrix')", details = "Recursive subsetting is deprecated for tibbles.", env = foreign_caller_env() ) - - return(as.matrix(x)[[j]]) } if (is.object(j)) { @@ -219,7 +217,7 @@ tbl_subset2 <- function(x, j, j_arg, call = caller_env()) { vectbl_as_col_location2(j, length(x), j_arg = j_arg, call = call) } } else if (length(j) == 2L) { - deprecate_soft("3.0.0", "tibble::`[[.tbl_df`(j = 'can\\'t be a vector of length 2')", + deprecate_stop("3.0.0", "tibble::`[[.tbl_df`(j = 'can\\'t be a vector of length 2')", details = "Recursive subsetting is deprecated for tibbles.", env = foreign_caller_env() ) diff --git a/R/tibble-package.R b/R/tibble-package.R index 79949e33f..1a5b82ea8 100644 --- a/R/tibble-package.R +++ b/R/tibble-package.R @@ -1,6 +1,7 @@ ## usethis namespace: start #' @importFrom lifecycle deprecate_soft #' @importFrom lifecycle deprecate_warn +#' @importFrom lifecycle deprecate_stop #' @importFrom lifecycle expect_deprecated #' @importFrom pkgconfig set_config #' @importFrom utils head tail diff --git a/revdep/cran.md b/revdep/cran.md index ae01a5d5b..c3e72c274 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 5 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 3 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 2 new problems * We failed to check 0 packages diff --git a/revdep/problems.md b/revdep/problems.md index af06d65c7..8032771f5 100644 --- a/revdep/problems.md +++ b/revdep/problems.md @@ -6,7 +6,7 @@ * GitHub: https://github.com/kiangkiangkiang/ggESDA * Source code: https://github.com/cran/ggESDA * Date/Publication: 2022-08-19 08:40:10 UTC -* Number of recursive dependencies: 206 +* Number of recursive dependencies: 208 Run `revdepcheck::cloud_details(, "ggESDA")` for more info @@ -29,7 +29,7 @@ Run `revdepcheck::cloud_details(, "ggESDA")` for more info > data(Cardiological) > ggInterval_index(Cardiological, aes(x = Syst)) Error in get(x, envir = ns, inherits = FALSE) : - object 'tbl_subset_row' not found + object 'tbl_subset_col' not found Calls: ggInterval_index ... as.data.frame -> [ -> [.symbolic_tbl -> getFromNamespace -> get Execution halted ``` @@ -41,7 +41,7 @@ Run `revdepcheck::cloud_details(, "ggESDA")` for more info --- re-building ‘ggESDA.Rmd’ using rmarkdown Quitting from lines 47-57 (ggESDA.Rmd) Error: processing vignette 'ggESDA.Rmd' failed with diagnostics: - object 'tbl_subset_row' not found + object 'tbl_subset_col' not found --- failed re-building ‘ggESDA.Rmd’ SUMMARY: processing the following file failed: @@ -82,7 +82,7 @@ Run `revdepcheck::cloud_details(, "RSDA")` for more info > data(abalone) > res <- sym.pca(abalone, 'centers') Error in get(x, envir = ns, inherits = FALSE) : - object 'tbl_subset_row' not found + object 'tbl_subset_col' not found Calls: sym.pca ... %in% -> [ -> [.symbolic_tbl -> getFromNamespace -> get Execution halted ``` @@ -94,7 +94,7 @@ Run `revdepcheck::cloud_details(, "RSDA")` for more info --- re-building ‘introduction.Rmd’ using rmarkdown Quitting from lines 60-64 (introduction.Rmd) Error: processing vignette 'introduction.Rmd' failed with diagnostics: - object 'tbl_subset_row' not found + object 'tbl_subset_col' not found --- failed re-building ‘introduction.Rmd’ SUMMARY: processing the following file failed: diff --git a/tests/testthat/_snaps/vignette-invariants/invariants.md b/tests/testthat/_snaps/vignette-invariants/invariants.md index 537f3f4e9..9bda056eb 100644 --- a/tests/testthat/_snaps/vignette-invariants/invariants.md +++ b/tests/testthat/_snaps/vignette-invariants/invariants.md @@ -321,9 +321,9 @@ df[[1:2]] ```r tbl[[1:2]] -#> Warning: The `j` argument of `[[.tbl_df` can't be a vector of length 2 as of tibble 3.0.0. +#> Error: +#> ! The `j` argument of `[[.tbl_df` can't be a vector of length 2 as of tibble 3.0.0. #> i Recursive subsetting is deprecated for tibbles. -#> [1] NA ```