R/class_timespan_compat_vctrs.R

Defines functions obj_print_footer.timespan obj_print_data.timespan vec_ptype_abbr.timespan vec_ptype_full.timespan

#' @importFrom vctrs vec_ptype_full
#' @export
vec_ptype_full.timespan <- function(x, ...) {
  "timespan"
}



#' @importFrom vctrs vec_ptype_abbr
#' @export
vec_ptype_abbr.timespan <- function(x, ..., prefix_named, suffix_shape) {
  "tmspn"
}



#' @importFrom vctrs obj_print_data
#' @export
obj_print_data.timespan <- function(x, ...) {
  if (!length(x)) return(invisible(x))
  cat(format_vector(format(x, ...)), "\n")
  invisible(x)
}



#' @importFrom vctrs obj_print_footer
#' @export
obj_print_footer.timespan <- function(x, ...) {
  l <- length(x) - getOption("max.print")
  if (l > 0)
    cat(sprintf("[ reached getOption(\"max.print\") -- omitted %.f entries ]", l))
}

Try the parttime package in your browser

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

parttime documentation built on May 29, 2024, 6:25 a.m.