Learn R Programming

neatR (version 0.3.0)

ndate: neat representation of dates

Description

neat representation of dates

Usage

ndate(
  date,
  show_weekday = TRUE,
  show_month_year = FALSE,
  display_weekday = NULL,
  is_month = NULL
)

Value

String representation of the date

Arguments

date

a Date or POSIX time stamp

show_weekday

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

show_month_year

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.

display_weekday

Deprecated. Use 'show_weekday' instead.

is_month

Deprecated. Use 'show_month_year' instead.

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, show_weekday = FALSE)
# Neat representation of current date with only month and year
ndate(x, show_weekday = FALSE, show_month_year = TRUE)

Run the code above in your browser using DataLab