Skip to content

Commit

Permalink
- is_vector_s3() is no longer reexported from pillar (#789).
Browse files Browse the repository at this point in the history
Closes #789.
  • Loading branch information
krlmlr committed Jul 6, 2020
1 parent 336302b commit 458153d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export(has_name)
export(has_rownames)
export(is.tibble)
export(is_tibble)
export(is_vector_s3)
export(knit_print.trunc_mat)
export(lst)
export(lst_)
Expand All @@ -77,7 +76,6 @@ import(lifecycle)
import(rlang)
importFrom(magrittr,"%>%")
importFrom(methods,setOldClass)
importFrom(pillar,is_vector_s3)
importFrom(pillar,new_pillar_title)
importFrom(pillar,new_pillar_type)
importFrom(pillar,obj_sum)
Expand Down
8 changes: 2 additions & 6 deletions R/tbl_sum.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return A named character vector, describing the dimensions in the first element
#' and the data source in the name of the first element.
#'
#' @seealso [pillar::type_sum()], [pillar::is_vector_s3()]
#' @seealso [pillar::type_sum()]
#' @param x Object to summarise
#' @export
# Can be overridden in .onLoad()
Expand All @@ -34,7 +34,7 @@ dim_desc <- function(x) {
}

size_sum <- function(x) {
if (!is_vector_s3(x)) return("")
if (!vec_is(x)) return("")

paste0(" [", dim_desc(x), "]")
}
Expand All @@ -49,7 +49,3 @@ pillar::type_sum

#' @export
type_sum.tbl_df <- function(x) "tibble"

#' @importFrom pillar is_vector_s3
#' @export
pillar::is_vector_s3
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 man/tbl_sum.Rd

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

7 changes: 2 additions & 5 deletions tests/testthat/tbl_sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
> dim_desc(1:3)
[1] "3"

> size_sum(iris)
Warning: `is_vector_s3()` is soft-deprecated in favor of `vctrs::vec_is()`.
This warning is displayed once per session.

[1] " [150 x 5]"
> size_sum(trees)
[1] " [31 x 3]"

> size_sum(Titanic)
[1] " [4 x 2 x 2 x 2]"
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tbl_sum.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_that("output", {
dim_desc(Titanic)
dim_desc(1:3)

size_sum(iris)
size_sum(trees)
size_sum(Titanic)
size_sum(1:3)
})
Expand Down

0 comments on commit 458153d

Please sign in to comment.