date_utils: Various date utilities

Description Usage Arguments Format See Also Examples

Description

Date() mirrors primitive contructors in base R (double(), character() etc.)

Usage

1
2
3
4
5

Arguments

x

an R object

length

A non-negative number specifying the desired length. Supplying an argument of length other than one is an error.

Format

An object of class Date of length 1.

See Also

is.instant(), is.timespan(), is.POSIXt(), POSIXct()

Examples

1
2
is.Date(as.Date("2009-08-03")) # TRUE
is.Date(difftime(now() + 5, now())) # FALSE

Example output

Attaching package: 'lubridate'

The following object is masked from 'package:base':

    date

[1] TRUE
[1] FALSE

lubridate documentation built on Feb. 26, 2021, 5:09 p.m.