R/print.R

Defines functions vec_ptype_abbr.rowwise_tt tbl_sum.rowwise_tt vec_ptype_abbr.grouped_tt tbl_sum.grouped_tt vec_ptype_abbr.tidytable tbl_sum.tidytable

# tidytable ---------------------------
#' @export
tbl_sum.tidytable <- function(x) {
  c("A tidytable" = dim_desc(x))
}

#' @export
vec_ptype_abbr.tidytable <- function(x, ..., prefix_named = FALSE, suffix_shape = TRUE) {
  "tidytable"
}

# grouped_tt ---------------------------
#' @export
tbl_sum.grouped_tt <- function(x) {
  groups <- glue_collapse(group_vars(x), sep = ", ")
  c("A tidytable" = dim_desc(x), "Groups" = groups)
}

#' @export
vec_ptype_abbr.grouped_tt <- function(x, ..., prefix_named = FALSE, suffix_shape = TRUE) {
  "grouped_tt"
}

# rowwise_tt ---------------------------
#' @export
tbl_sum.rowwise_tt <- function(x) {
  c("A rowwise tidytable" = dim_desc(x))
}

#' @export
vec_ptype_abbr.rowwise_tt <- function(x, ..., prefix_named = FALSE, suffix_shape = TRUE) {
  "rowwise_tt"
}

Try the tidytable package in your browser

Any scripts or data that you put into this service are public.

tidytable documentation built on Sept. 11, 2024, 8:05 p.m.