hadley / r4ds

R for data science: a book
http://r4ds.hadley.nz
Other
4.59k stars 4.22k forks source link

Issue in Table 18.1 : %e and %d switched? #1550

Closed AsdaeSunspark closed 1 year ago

AsdaeSunspark commented 1 year ago

Hello all,

I may have found a problem with the date time format parameter to parse_date, or to this book's table. I think %e and %d may be switched, as %d handles 1-digit days just fine, but %e does not. This is my first contribution ever and I'm a bit lost, so sorry if I'm missing some etiquette, but here is a minimal reproducible example :

# Works just fine, as intended in the documentation
parse_date("January 01 2010", format = "%B %d %Y")

# Also works, while the documentation says it should not
parse_date("January 1 2010", format = "%B %d %Y")

# Does not work, while the documentation says it should
parse_date("January 1 2010", format = "%B %e %Y")

# Works, in accordance with the documentation
parse_date("January 01 2010", format = "%B %e %Y")

Please tell me it's not just my computer ...

Yours truly,

Asdae

mine-cetinkaya-rundel commented 1 year ago

Thank you!