Learn R Programming

humanize (version 0.2.0)

natural_day: Natural Day

Description

For date values that are tomorrow, today or yesterday compared to present day returns representing string. Otherwise, returns a string formatted according to fmt

Usage

natural_day(value, fmt = "%b %d")

Arguments

value

A date value

fmt

Optional formatting string for dates not yesterday, today, tomorrow

Value

A nicely formatted date

Examples

Run this code
# NOT RUN {
natural_day(Sys.Date())
natural_day(Sys.Date()-10)
# }

Run the code above in your browser using DataLab