is.Date: Test for a Date object

View source: R/str2str_functions.R

is.DateR Documentation

Test for a Date object

Description

is.Date returns whether an object is a Date object (aka has class = "Date").

Usage

is.Date(x)

Arguments

x

an object.

Value

TRUE is x has class "Date" and FALSE if x does not have class "Date".

Examples

date <- as.Date("2021-05-24", format = "%Y-%m-%d") # as.Date.character
is.Date(date)
class(date) <- append(class(date), "extra_class")
is.Date(date) # classes other than Date are allowed
is.Date(list(date)) # returns FALSE

str2str documentation built on Nov. 21, 2023, 1:08 a.m.