Learn R Programming

neatR (version 0.2.0)

ndate: neat representation of dates

Description

neat representation of dates

Usage

ndate(date, display.weekday = TRUE, is.month = FALSE)

Value

String representation of the date

Arguments

date

a Date or POSIX time stamp

display.weekday

a Boolean. Whether the weekday of the date to be included.

is.month

a Boolean variable representing if the date represents month. If this set to TRUE, the function returns 'MMMM'YY' as the output which is a neater representation of month.

Examples

Run this code
# Neat representation of current date
x <- Sys.Date()
ndate(x)
# Neat representation of current date with day of week.
ndate(x, display.weekday = FALSE)
# Neat representation of current date with only month and year
ndate(x, display.weekday = FALSE, is.month = TRUE)

Run the code above in your browser using DataLab