Description Usage Arguments Value Examples
Uses regular expressions to sub out a single day or month with a leading zero and then coerces to a date object.
1 | fix_mdyyyy(x, ...)
|
x |
A character date in the form of m/d/yyyy where m and d can be single integers like 1 for January. |
... |
ignored. |
Returns a data vector
1 2 3 4 5 6 7 8 9 10 11 12 | fix_mdyyyy(c('4/23/2017', '12/1/2016', '3/3/2013', '12/12/2012', '2013-01-01'))
## Not run:
library(dplyr)
data_frame(
x = 1:4,
y = LETTERS[1:4],
start_date = c('4/23/2017', '12/1/2016', '3/3/2013', '12/12/2012'),
end_date = c('5/23/2017', '12/9/2016', '3/3/2016', '2/01/2012')
) %>%
mutate_at(vars(ends_with('_date')), fix_mdyyyy)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.