converting date from string r
#Return "2021-01-20" in yyyy-mm-dd format.
ymd("2021-01-20")
#> [1] "2021-01-20"
#Return "January 20th, 2021" in yyyy-mm-dd format.
mdy("January 20th, 2021")
#> [1] "2021-01-20"
#Return "20-Jan-2021" in yyyy-mm-dd format.
dmy("20-Jan-2021")
#> [1] "2021-01-20"
#These functions also take unquoted numbers and convert them into the yyyy-mm-dd format.
ymd(20210120)
#> [1] "2021-01-20"