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
.
# S3 method for class 'cnd_df'
tbl_sum(x, ...)
A character vector with header values of the conditioned data frame.
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"