makeup_dat: makeup_dat

View source: R/dates.R

makeup_datR Documentation

makeup_dat

Description

Formats date values for human use. You can set an example of how the output is wanted and a certain locale setting.

Usage

makeup_dat(v, sample = NULL, locale = NULL, format = NULL)

Arguments

v

character value to be formatted

sample

a character value as an example of how the output is wanted. Days and years must be as numbers.

locale

character string naming a locale. For example: "es-MX" for mexico locale setting. You can check your default system locale with Sys.getlocale(). See available values for setting up at makeup::available_locales

format

a character vector of date-time formats. Default is "%-m/%-d/%Y"

Value

a character value with a specific date format

Examples


  v <- "2020-03-04"
  makeup_dat(v, sample = "Ene 3", locale = "es-CO")
  makeup_dat(v, sample = "Enero 3", locale = "es-CO")
  makeup_dat(v, sample = "Enero 3 2022", locale = "es-CO")
  makeup_dat(v, sample = "2022 Enero 3", locale = "es-CO")

  ### Sample doesnt' work with day as a text value
  makeup_dat(v, sample = "Tres de Enero", locale = "es-CO")



datasketch/makeup documentation built on Feb. 21, 2025, 6:53 a.m.