type_sum: Provide a succinct summary of an object

Description Usage Arguments Lifecycle Examples

View source: R/type-sum.R

Description

Questioning lifecycle

type_sum() gives a brief summary of object type. Objects that commonly occur in a data frame should return a string with four or less characters. For most inputs, the argument is forwarded to vctrs::vec_ptype_abbr().

obj_sum() also includes the size of the object if vctrs::vec_is() is TRUE.

Usage

1
2
3

Arguments

x

an object to summarise. Generally only methods of atomic vectors and variants have been implemented.

Lifecycle

type_sum() is in the "questioning" stage, because vctrs::vec_ptype_abbr() provides essentially the same functionality based on a robust framework. The generic will remain available for a while. Users and implementers are encouraged to consider vctrs::vec_ptype_abbr() once it becomes stable.

Examples

1
2
3
4
5

Example output

[1] "int [10]"
[1] "int [10 x 1]"
[1] "date [1]"
[1] "dttm [1]"
[1] "fn"

pillar documentation built on Nov. 20, 2020, 9:06 a.m.