Skip to content

Commit

Permalink
Merge pull request #349 from r-lib/b-321-doc-obj-sum
Browse files Browse the repository at this point in the history
- `obj_sum()` no longer calls `type_sum()` for vectors since pillar v1.6.1, this is now documented (#321).
  • Loading branch information
krlmlr authored Jul 26, 2021
2 parents e0d6c68 + bef9d31 commit 99d5c09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions R/type-sum.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ vec_ptype_abbr.pillar_empty_col <- function(x, ...) {
}

#' @description
#' `obj_sum()` also includes the size of the object if [vctrs::vec_is()]
#' is `TRUE`.
#' `obj_sum()` also includes the size (but not the shape) of the object
#' if [vctrs::vec_is()] is `TRUE`.
#' It should always return a string (a character vector of length one).
#' As of pillar v1.6.1, the default method forwards to [vctrs::vec_ptype_abbr()]
#' for vectors and to [type_sum()] for other objects.
#' Previous versions always forwarded to [type_sum()].
#'
#' @keywords internal
#' @examples
#' obj_sum(1:10)
#' obj_sum(matrix(1:10))
Expand Down
7 changes: 5 additions & 2 deletions man/type_sum.Rd

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

0 comments on commit 99d5c09

Please sign in to comment.