pretty_date: Create a full date with an ordinal date

Description Usage Arguments Value Examples

View source: R/dateOps.R

Description

This function is useful for formatting dates in reports - especially in the header of an Rmarkdown report. Default behavior uses today's date. See strptime for details on month and year code strings.

Usage

1
pretty_date(x = Sys.Date(), month_code = "%B", year_code = "%Y")

Arguments

x

a date object to convert to a string

month_code

the code used to format the month - defaults to full month name

year_code

the code used to format the year - defaults to full 4 digit year

Value

a length 1 character vector

Examples

1
2
3
4
5
# returns nice format for today's date
pretty_date()

pretty_date(as.Date('2020-03-01'))
# March 1st, 2020

West-End-Statistics/r-library-vakdr documentation built on Dec. 18, 2021, 7:16 p.m.