is.Date {str2str}R 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

[Package str2str version 1.0.0 Index]