HyeonPhil Youn
HyeonPhil Youn

Reputation: 458

Error with treating dates, lubridate package in R

Hey look what I found out.

Reading link, 16.2.1, I tried the followings.

library(lubridate)
library(tidyverse)
> mdy("January 31st, 2017")
[1] "2017-03-01"
> mdy("January 29th, 2017")
[1] "2017-02-09"

What is wrong here?

The following works quite good, so I don't think locale thing is the problem..?

> mdy("January 1st, 2017")
[1] "2017-01-01"

Upvotes: 1

Views: 64

Answers (1)

akrun
akrun

Reputation: 887911

Not able to reproduce the issue with packageVersion 1.7.4

library(lubridate) # v 1.7.4
mdy("January 31st, 2017")
#[1] "2017-01-31" 
mdy("January 29th, 2017")
#[1] "2017-01-29"

Upvotes: 3

Related Questions