| trim_dates | R Documentation | 
Removes unknown elements from a partial date. For example, "2017-UN-UN"
is trimmed to "2017" and "2017-05-UN" is trimmed to "2017-05".
Values of "UNKN-UN-UN" are converted to NA. Values where only
the year and day are known are converted to just the year, ie "2017-UN-01"
converts to "2017". Full dates are not modified.
trim_dates(dates, input_sep = "-")
| dates | a character vector of partial dates in the format  | 
| input_sep | the character that separates date components in the input
vector  | 
a character vector of trimmed partial dates and full dates
reshape_adates(), reshape_pdates(), impute_pdates(),
vignette("Dates")
dates <- c(
  "UNKN-UN-UN",
  "2017-UN-UN",
  "2017-02-UN",
  "2017-UN-05",
  "2017-09-03",
  "UNKN-07-14",
  NA
)
trim_dates(dates)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.