cleanDate | R Documentation |
Clean a date and reformat it to another style.
cleanDate(
x,
original.format,
preferred.format,
existing.missing.codes = "",
return.missing.code = NA,
sep = "/"
)
x |
a date string or a numeric representation of a date (e.g. January 13th, 1991 would be 19910113) |
original.format |
format of input |
preferred.format |
format to change |
existing.missing.codes |
missing dates |
return.missing.code |
what to return if there is a missing input |
sep |
date separator. Defaults to "/" |
A date string cleaned and formatted from the original (unformatted) date
Samuel Leung, Derek Chiu
Other date formatting functions:
chr_to_date()
,
formatDate()
,
getFormat()
,
numericToDate()
cleanDate("09/11/1991", original.format = "MM.DD.YYYY", preferred.format = "DD.MM.YYYY")
cleanDate(11091991, original.format = "DD.MM.YYYY", preferred.format = "YYYY.MMM.DD")
cleanDate(11091991, original.format = "DD.MM.YYYY", preferred.format = "YYYY.MMM.DD", sep = "-")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.