Skip to contents

Conditioned tibble header print method. This S3 method adds an extra line in the header of a tibble that indicates the tibble is a conditioned tibble (# Cond. tbl:) followed by the tally of the conditioning vector: number of TRUE, FALSE and NA values: e.g., 1/1/1.

Usage

# S3 method for cnd_df
tbl_sum(x, ...)

Arguments

x

A conditioned tibble of class cnd_df.

...

Additional arguments passed to the default print method.

Value

A character vector with header values of the conditioned data frame.

Examples

df <- data.frame(x = c(1L, NA_integer_, 3L))
(cnd_df <- condition_add(dat = df, x >= 2L))
#> # A tibble:  3 × 1
#> # Cond. tbl: 1/1/1
#>         x
#>     <int>
#> 1 F     1
#> 2 -    NA
#> 3 T     3
pillar::tbl_sum(cnd_df)
#>  A tibble Cond. tbl 
#>   "3 × 1"   "1/1/1"