R/class_partial_time_rep.R

Defines functions rep_len.partial_time rep.partial_time

#' @export
rep.partial_time <- function(x, ..., length.out) {
  if (!missing(length.out))
    return(rep_len.partial_time(x, length.out))
  vctrs::vec_repeat(x, ...)
}



rep_len.partial_time <- function(x, length.out) {
  x[rep_len(vctrs::vec_seq_along(x), length.out = length.out)]
}

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.