Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tbl_sum() reexport #6284

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ export(tbl)
export(tbl_df)
export(tbl_nongroup_vars)
export(tbl_ptype)
export(tbl_sum)
export(tbl_vars)
export(tibble)
export(top_frac)
Expand Down Expand Up @@ -483,6 +482,7 @@ importFrom(lifecycle,deprecated)
importFrom(magrittr,"%>%")
importFrom(methods,is)
importFrom(pillar,glimpse)
importFrom(pillar,tbl_sum)
importFrom(pillar,type_sum)
importFrom(stats,lag)
importFrom(stats,setNames)
Expand All @@ -494,7 +494,6 @@ importFrom(tibble,data_frame)
importFrom(tibble,is_tibble)
importFrom(tibble,lst)
importFrom(tibble,new_tibble)
importFrom(tibble,tbl_sum)
importFrom(tibble,tibble)
importFrom(tibble,tribble)
importFrom(tibble,view)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# dplyr (development version)

* `tbl_sum()` is no longer reexported from tibble (#6284).

* `slice_sample()` now gives a more informative error when `replace = FALSE` and
the number of rows requested in the sample exceeds the number of rows in the
data (#6271).
Expand Down
1 change: 1 addition & 0 deletions R/grouped-df.r
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ group_sum <- function(x) {
paste0(commas(group_vars(x)), " [", big_mark(grps), "]")
}

#' @importFrom pillar tbl_sum
#' @export
tbl_sum.grouped_df <- function(x, ...) {
c(
Expand Down
4 changes: 0 additions & 4 deletions R/reexport-tibble.r
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,3 @@ tibble::as_tibble

#' @importFrom tibble view
tibble::view

#' @importFrom tibble tbl_sum
#' @export
tibble::tbl_sum
1 change: 1 addition & 0 deletions R/rowwise.r
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ setOldClass(c("rowwise_df", "tbl_df", "tbl", "data.frame"))

# methods -----------------------------------------------------------------

#' @importFrom pillar tbl_sum
#' @export
tbl_sum.rowwise_df <- function(x, ...) {
c(
Expand Down
3 changes: 1 addition & 2 deletions man/reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-group-by.r
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ test_that("group_by() does not mutate for nothing when using the .data pronoun (
})

test_that("tbl_sum gets the right number of groups", {
res <- data.frame(x=c(1,1,2,2)) %>% group_by(x) %>% tbl_sum()
res <- data.frame(x=c(1,1,2,2)) %>% group_by(x) %>% pillar::tbl_sum()
expect_equal(res, c("A tibble" = "4 x 1", "Groups" = "x [2]"))
})

Expand Down