R/is.R

Defines functions is_time is.hms is_date is.Date is_date_time is.POSIXct

Documented in is_date is.Date is_date_time is.hms is.POSIXct is_time

#' Is Date/Time
#'
#' Tests whether an object is a Date, POSIXct, or hms vector.
#'
#' @param x An object
#' @return A flag indicating whether x inherits from Date, POSIXct or hms.
#' @family is
#' @name is_date_time
NULL

#' @rdname is_date_time
#' @export
is.POSIXct <- function(x) inherits(x, "POSIXct")

#' @rdname is_date_time
#' @export
is_date_time <- function(x) inherits(x, "POSIXct")

#' @rdname is_date_time
#' @export
is.Date <- function(x) inherits(x, "Date")

#' @rdname is_date_time
#' @export
is_date <- function(x) inherits(x, "Date")

#' @rdname is_date_time
#' @export
is.hms <- function(x) inherits(x, "hms")

#' @rdname is_date_time
#' @export
is_time <- function(x) inherits(x, "hms")

Try the dttr2 package in your browser

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

dttr2 documentation built on Sept. 19, 2021, 9:06 a.m.