R/supertibble.R

Defines functions tbl_sum.redcap_supertbl vec_ptype_abbr.redcap_supertbl as_supertbl

Documented in as_supertbl tbl_sum.redcap_supertbl vec_ptype_abbr.redcap_supertbl

#' @title
#' Add supertbl S3 class
#'
#' @param x an object to class
#'
#' @return
#' The object with `redcaptidier_supertbl` S3 class
#'
#' @keywords internal
#'
as_supertbl <- function(x) {
  class(x) <- c("redcap_supertbl", class(x))
  x
}

#' @inherit vctrs::vec_ptype_abbr params return title description
#' @export
vec_ptype_abbr.redcap_supertbl <- function(x, ..., prefix_named, suffix_shape) {
  "suprtbl"
}

#' @inherit pillar::tbl_sum params return title description
#' @export
tbl_sum.redcap_supertbl <- function(x) {
  paste("A REDCapTidieR Supertibble with", nrow(x), "instruments")
}

Try the REDCapTidieR package in your browser

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

REDCapTidieR documentation built on April 3, 2025, 10:50 p.m.