R/coerce.R

Defines functions vec_ptype2.hms.difftime vec_ptype2.difftime.hms vec_ptype2.hms.hms vec_ptype2.hms.default vec_ptype2.hms

Documented in vec_ptype2.hms

#' Coercion
#'
#' Double dispatch methods to support [vctrs::vec_ptype2()].
#'
#' @inheritParams vctrs::vec_ptype2
#'
#' @method vec_ptype2 hms
#' @export
#' @export vec_ptype2.hms
vec_ptype2.hms <- function(x, y, ..., x_arg = "", y_arg = "") UseMethod("vec_ptype2.hms", y)

#' @method vec_ptype2.hms default
#' @export
vec_ptype2.hms.default <- function(x, y, ..., x_arg = "", y_arg = "") {
  vec_default_ptype2(x, y, x_arg = x_arg, y_arg = y_arg)
}

#' @method vec_ptype2.hms hms
#' @export
vec_ptype2.hms.hms <- function(x, y, ...) hms::hms()

#' @method vec_ptype2.difftime hms
#' @export
vec_ptype2.difftime.hms <- function(x, y, ...) new_hms()

#' @method vec_ptype2.hms difftime
#' @export
vec_ptype2.hms.difftime <- function(x, y, ...) new_hms()

Try the hms package in your browser

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

hms documentation built on March 31, 2023, 11:09 p.m.